From: Jim Meyering <meyering@redhat•com>
To: git list <git@vger•kernel.org>
Subject: [PATCH] * remote.c (valid_fetch_refspec): remove useless if-before-free test
Date: Tue, 19 Aug 2008 20:46:30 +0200 [thread overview]
Message-ID: <87k5ecx2pl.fsf@rho.meyering.net> (raw)
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>
---
There are four in regex.c, too, but that's imported code,
so probably not worth modifying in git:
compat/regex.c: if (var) free (var)
compat/regex.c: if (preg->buffer != NULL)
free (preg->buffer)
compat/regex.c: if (preg->fastmap != NULL)
free (preg->fastmap)
compat/regex.c: if (preg->translate != NULL)
free (preg->translate)
remote.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/remote.c b/remote.c
index f61a3ab..105668f 100644
--- 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;
}
--
1.6.0.9.gae2e487
next reply other threads:[~2008-08-19 18:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-19 18:46 Jim Meyering [this message]
2008-08-20 19:40 ` [PATCH] * remote.c (valid_fetch_refspec): remove useless if-before-free test Alex Riesen
2008-08-20 20:22 ` Jim Meyering
2008-08-20 23:38 ` Brandon Casey
2008-08-21 0:16 ` Junio C Hamano
2008-08-21 0:33 ` Brandon Casey
2008-08-21 2:42 ` Junio C Hamano
2008-08-22 0:16 ` [PATCH] remote.c: add a function for deleting a refspec array and use it (twice) Brandon Casey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k5ecx2pl.fsf@rho.meyering.net \
--to=meyering@redhat$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox