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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user