mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
bozo: Fix memory leak in ez_create()
Currently, ez_create() fails to release cmdpath when it returns early due to a failure returned by bnode_InitBnode(). This commit resolves this issue by ensuring that cmdpath is properly deallocated in such failure scenarios, thereby preventing memory leaks. Change-Id: I03b137f9f45eca41c538574d842e99445bf55b2c Reviewed-on: https://gerrit.openafs.org/15718 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
This commit is contained in:
parent
159bd949a4
commit
7ff6517b94
@ -117,6 +117,7 @@ ez_create(char *ainstance, char *acommand, char *unused1, char *unused2,
|
||||
te = calloc(1, sizeof(struct ezbnode));
|
||||
if (bnode_InitBnode((struct bnode *)te, &ezbnode_ops, ainstance) != 0) {
|
||||
free(te);
|
||||
free(cmdpath);
|
||||
return NULL;
|
||||
}
|
||||
te->command = cmdpath;
|
||||
|
Loading…
Reference in New Issue
Block a user