From: Eric Sandeen Date: Wed, 6 Nov 2013 23:15:40 +0000 (-0600) Subject: btrfs-progs: fix potential double-frees in cmd_subvol_delete() X-Git-Tag: upstream/4.16.1~3053 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83e941a746e71aa54da2b4bb2c22077c51d31082;p=platform%2Fupstream%2Fbtrfs-progs.git 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 Signed-off-by: Chris Mason --- diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 96fdcca..f57694a 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;