btrfs-progs: fix potential double-frees in cmd_subvol_delete()

If we "goto again" in cmd_subvol_delete(), and error out to out:
before re-allocating the dupdname and dupvname pointers, we'll
double-free them.

Set them to NULL after freeing to avoid this.

Resolves-Coverity-CID: 1125944
Resolves-Coverity-CID: 1125945
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
master
Eric Sandeen 2013-11-06 17:15:40 -06:00 committed by Chris Mason
parent 55d3729d4c
commit 83e941a746
1 changed files with 2 additions and 0 deletions

View File

@ -288,6 +288,8 @@ again:
out:
free(dupdname);
free(dupvname);
dupdname = NULL;
dupvname = NULL;
cnt++;
if (cnt < argc)
goto again;