diff --git a/sha1_name.c b/sha1_name.c
index 89b9e3b77af068b93e720dc03e71ad189fefb116..1fbc4438059b68f31aa25fb8e3b82b37a4d02819 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
if (len < MINIMUM_ABBREV)
return -1;
- memset(res, 0, 20);
+ hashclr(res);
memset(canonical, 'x', 40);
for (i = 0; i < len ;i++) {
unsigned char c = name[i];
pathname = resolve_ref(git_path(*p, len, str), this_result, 1);
if (pathname) {
if (!refs_found++)
- real_path = strdup(pathname);
+ real_path = xstrdup(pathname);
if (!warn_ambiguous_refs)
break;
}