ima: use static const char array definitions

A const char pointer allocates memory for a pointer as well as for
a string,  This patch replaces a number of the const char pointers
throughout IMA, with a static const char array.

Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
This commit is contained in:
Mimi Zohar
2013-12-11 14:44:04 -05:00
parent 31d4b76189
commit 52a1328484
4 changed files with 10 additions and 10 deletions

View File

@@ -329,7 +329,7 @@ void __init ima_init_policy(void)
*/
void ima_update_policy(void)
{
const char *op = "policy_update";
static const char op[] = "policy_update";
const char *cause = "already exists";
int result = 1;
int audit_info = 0;
@@ -645,7 +645,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
*/
ssize_t ima_parse_add_rule(char *rule)
{
const char *op = "update_policy";
static const char op[] = "update_policy";
char *p;
struct ima_rule_entry *entry;
ssize_t result, len;