Code

remote.c: remove useless if-before-free test
authorJim Meyering <meyering@redhat.com>
Tue, 19 Aug 2008 18:46:30 +0000 (20:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Aug 2008 04:09:30 +0000 (21:09 -0700)
We removed a handful of these useless if-before-free tests several months
ago.  This change removes a new one that snuck back in.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c

index f61a3ab399aa6960fb8eba050321cea4a3b05344..105668f8a3cf13c2a759e9da4d0acc50ef781de9 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -579,8 +579,7 @@ int valid_fetch_refspec(const char *fetch_refspec_str)
        struct refspec *refspec;
 
        refspec = parse_refspec_internal(1, fetch_refspec, 1, 1);
-       if (refspec)
-               free(refspec);
+       free(refspec);
        return !!refspec;
 }