Commit Diff


commit - d0b44960142368b275a21395ef0ad4109244069c
commit + 0a71ee675b38a8babaf66b701dde4465726c7ac4
blob - f6ad8c955953171c192610b6303a3bfc076676d3
blob + b0e1612550a4505b3fd70edab7d9d500fa274102
--- lib/pack.c
+++ lib/pack.c
@@ -407,7 +407,7 @@ search_packidx(struct got_packidx_v2_hdr **packidx, in
 		if (*idx != -1) {
 			*packidx = dup_packidx(repo->packidx_cache[i]);
 			if (*packidx == NULL)
-				*idx = -1;
+				return got_error(GOT_ERR_NO_MEM);
 			return NULL;
 		}
 	}