smbget: Fix a memory leak
authorAndreas Schneider <asn@samba.org>
Tue, 21 Jun 2016 13:56:23 +0000 (15:56 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 24 Jun 2016 00:01:19 +0000 (02:01 +0200)
Found by cppcheck.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/utils/smbget.c

index 4909fa2ca075e056b1f4ed93a6660f8d7d8ebd43..99261e3740d6a6d0f530b2220106104d31bb0151 100644 (file)
@@ -256,6 +256,7 @@ static bool smb_download_dir(const char *base, const char *name, int resume)
                if (!ok) {
                        fprintf(stderr, "Failed to download %s: %s\n",
                                newname, strerror(errno));
+                       free(tmpname);
                        return false;
                }
                free(newname);