clone.c: don't leak memory in cmd_clone
authorStefan Beller <stefanbeller@gmail.com>
Sun, 10 Aug 2014 13:57:56 +0000 (15:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Aug 2014 23:41:14 +0000 (16:41 -0700)
Free the refspec.
Found by scan.coverity.com (Id: 1127806)

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c

index 545105a..9129eb7 100644 (file)
@@ -1000,5 +1000,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        strbuf_release(&key);
        strbuf_release(&value);
        junk_mode = JUNK_LEAVE_ALL;
+
+       free(refspec);
        return err;
 }