]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/pack-objects.c
Merge branch 'en/header-cleanup'
[thirdparty/git.git] / builtin / pack-objects.c
index ab1c9de9815de034e9aee6b4b31d721f32dc27c0..5c8bfe1035feca3518d2ab6b2515c03adf9d75eb 100644 (file)
@@ -3201,7 +3201,7 @@ static int git_pack_config(const char *k, const char *v,
                return 0;
        }
        if (!strcmp(k, "uploadpack.blobpackfileuri")) {
-               struct configured_exclusion *ex = xmalloc(sizeof(*ex));
+               struct configured_exclusion *ex;
                const char *oid_end, *pack_end;
                /*
                 * Stores the pack hash. This is not a true object ID, but is
@@ -3209,6 +3209,10 @@ static int git_pack_config(const char *k, const char *v,
                 */
                struct object_id pack_hash;
 
+               if (!v)
+                       return config_error_nonbool(k);
+
+               ex = xmalloc(sizeof(*ex));
                if (parse_oid_hex(v, &ex->e.oid, &oid_end) ||
                    *oid_end != ' ' ||
                    parse_oid_hex(oid_end + 1, &pack_hash, &pack_end) ||