]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/hash-object.c
prefix_filename: return newly allocated string
[thirdparty/git.git] / builtin / hash-object.c
index 2ea36909d2443dc704c035d57840f804fb6f6401..bbeaf20bcca1ae1e9bfa55b5a8e4adbed83c00e8 100644 (file)
@@ -145,7 +145,7 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix)
                char *to_free = NULL;
 
                if (prefix)
-                       arg = to_free = xstrdup(prefix_filename(prefix, arg));
+                       arg = to_free = prefix_filename(prefix, arg);
                hash_object(arg, type, no_filters ? NULL : vpath ? vpath : arg,
                            flags, literally);
                free(to_free);