Skip to contentSkip to conversation

libsepol: cil: remove double-free.

PATCH Applied Daniel Cashman 2 participants 2 messages Nov 11, 2016 – Nov 15, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsepol: cil: remove double-free.

From: dcashman <[email protected]>

Test: Untested patch.

Change-Id Icaf992ba1487098f2c4f16ac1017012f611281e9
---
 libsepol/cil/src/cil_binary.c | 1 -
 1 file changed, 1 deletion(-)
libsepol/cil/src/cil_binary.c +0 -1
index 5402272..a813201 100644
@@ -843,7 +843,6 @@ int cil_catalias_to_policydb(policydb_t *pdb, struct cil_alias *cil_alias)
 	key = cil_strdup(cil_alias->datum.fqn);
 	rc = symtab_insert(pdb, SYM_CATS, key, sepol_alias, SCOPE_DECL, 0, NULL);
 	if (rc != SEPOL_OK) {
-		free(key);
 		goto exit;
 	}
 	sepol_alias->s.value = sepol_cat->s.value;
Signature · 1 line
2.8.0.rc3.226.g39d4020
#1 lore raw
Quoted 6 lines · Daniel Cashman

From: dcashman <[email protected]>

Test: Untested patch.

Change-Id Icaf992ba1487098f2c4f16ac1017012f611281e9

Thanks, applied.

Quoted 17 lines
---
 libsepol/cil/src/cil_binary.c | 1 -
 1 file changed, 1 deletion(-)
libsepol/cil/src/cil_binary.c +0 -1
index 5402272..a813201 100644
@@ -843,7 +843,6 @@ int cil_catalias_to_policydb(policydb_t *pdb, struct cil_alias *cil_alias)
 	key = cil_strdup(cil_alias->datum.fqn);
 	rc = symtab_insert(pdb, SYM_CATS, key, sepol_alias, SCOPE_DECL, 0, NULL);
 	if (rc != SEPOL_OK) {
-		free(key);
 		goto exit;
 	}
 	sepol_alias->s.value = sepol_cat->s.value;