summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2013-11-06 17:15:40 -0600
committerChris Mason <chris.mason@fusionio.com>2013-11-07 16:10:40 -0500
commit83e941a746e71aa54da2b4bb2c22077c51d31082 (patch)
treed530f58774bda3c0330d96411325cee24e08a18e /cmds-subvolume.c
parent55d3729d4c26a9faa26176c2f73fb5ce2a0a558a (diff)
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>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 96fdcca7..f57694a1 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -288,6 +288,8 @@ again:
out:
free(dupdname);
free(dupvname);
+ dupdname = NULL;
+ dupvname = NULL;
cnt++;
if (cnt < argc)
goto again;