mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-12 08:49:33 +00:00
btrfs-progs: free local variable buf upon unsuccessful returns
The variable "buf" passed into find_collision() as parameter "name" should be freed on unsuccessful returns. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
5991043ea4
commit
0f2569b126
@ -284,6 +284,7 @@ static char *find_collision(struct metadump_struct *md, char *name,
|
||||
val = malloc(sizeof(struct name));
|
||||
if (!val) {
|
||||
fprintf(stderr, "Couldn't sanitize name, enomem\n");
|
||||
free(name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -295,6 +296,7 @@ static char *find_collision(struct metadump_struct *md, char *name,
|
||||
if (!val->sub) {
|
||||
fprintf(stderr, "Couldn't sanitize name, enomem\n");
|
||||
free(val);
|
||||
free(name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user