libselinux: selabel_get_digests_all_partial_matches: free memory after FTS_D block
Free all memory from `selabel_get_digests_all_partial_matches()` in case of success and failure. Found by clang-analyzer. Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
parent
7464272caa
commit
d0c02882b7
1 changed files with 5 additions and 5 deletions
|
@ -128,7 +128,7 @@ int main(int argc, char **argv)
|
|||
printf("No SHA1 digest available for: %s\n",
|
||||
ftsent->fts_path);
|
||||
printf("as file_context entry is \"<<none>>\"\n");
|
||||
break;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
printf("The file_context entries for: %s\n",
|
||||
|
@ -149,11 +149,11 @@ int main(int argc, char **argv)
|
|||
xattr_digest[i]);
|
||||
printf("%s\n", sha1_buf);
|
||||
}
|
||||
|
||||
free(xattr_digest);
|
||||
free(calculated_digest);
|
||||
free(sha1_buf);
|
||||
}
|
||||
cleanup:
|
||||
free(xattr_digest);
|
||||
free(calculated_digest);
|
||||
free(sha1_buf);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue