diff mbox

libsepol: cil: remove double-free.

Message ID 1478891564-11770-1-git-send-email-dcashman@android.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Daniel Cashman Nov. 11, 2016, 7:12 p.m. UTC
From: dcashman <dcashman@android.com>

Test: Untested patch.
Bug: https://code.google.com/p/android/issues/detail?id=226519
Change-Id: Icaf992ba1487098f2c4f16ac1017012f611281e9
Signed-off-by: Daniel Cashman <dcashman@android.com>
---
 libsepol/cil/src/cil_binary.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Stephen Smalley Nov. 15, 2016, 3:52 p.m. UTC | #1
On 11/11/2016 02:12 PM, Daniel Cashman wrote:
> From: dcashman <dcashman@android.com>
> 
> Test: Untested patch.
> Bug: https://code.google.com/p/android/issues/detail?id=226519
> Change-Id: Icaf992ba1487098f2c4f16ac1017012f611281e9
> Signed-off-by: Daniel Cashman <dcashman@android.com>

Thanks, applied.

> ---
>  libsepol/cil/src/cil_binary.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c
> index 5402272..a813201 100644
> --- a/libsepol/cil/src/cil_binary.c
> +++ b/libsepol/cil/src/cil_binary.c
> @@ -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;
>
diff mbox

Patch

diff --git a/libsepol/cil/src/cil_binary.c b/libsepol/cil/src/cil_binary.c
index 5402272..a813201 100644
--- a/libsepol/cil/src/cil_binary.c
+++ b/libsepol/cil/src/cil_binary.c
@@ -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;