diff options
author | Jim Meyering <jim@meyering.net> | 2007-06-12 22:59:21 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-12 22:16:29 -0700 |
commit | aa32eedc69e4966cc822a2f9f07c30b437e40b8c (patch) | |
tree | dc7ab2a1438f9da60925184c844bd8da6eb552a1 /remote.c | |
parent | c43f64a0afd7b4bd87ec83449995fad21b741af6 (diff) | |
download | git-aa32eedc69e4966cc822a2f9f07c30b437e40b8c.tar.gz git-aa32eedc69e4966cc822a2f9f07c30b437e40b8c.tar.xz |
Don't dereference a strdup-returned NULL
There are only a dozen or so uses of strdup in all of git.
Of those, most seem ok, but this one isn't:
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -542,7 +542,7 @@ int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail, strcpy(dst_name, pat->dst); strcat(dst_name, src->name + strlen(pat->src)); } else - dst_name = strdup(src->name); + dst_name = xstrdup(src->name); dst_peer = find_ref_by_name(dst, dst_name); if (dst_peer && dst_peer->peer_ref) /* We're already sending something to this ref. */ |