Commit 0a71ee675b38a8babaf66b701dde4465726c7ac4

Stefan Sperling 2018-03-09T18:12:10

return error from search_packidx() if dup_packidx() fails

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/pack.c b/lib/pack.c
index f6ad8c9..b0e1612 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -407,7 +407,7 @@ search_packidx(struct got_packidx_v2_hdr **packidx, int *idx,
 		if (*idx != -1) {
 			*packidx = dup_packidx(repo->packidx_cache[i]);
 			if (*packidx == NULL)
-				*idx = -1;
+				return got_error(GOT_ERR_NO_MEM);
 			return NULL;
 		}
 	}