Commit 0adc7bcc3f16033b549ab06c8a1bd0007bb5a7d9

Stefan Sperling 2019-06-29T23:28:23

call got_object_id_queue_free() instead of implementing it inline

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/lib/pack.c b/lib/pack.c
index f002e06..d9d0f11 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -496,14 +496,8 @@ got_packidx_match_id_str_prefix(struct got_object_id_queue *matched_ids,
 		oid = &packidx->hdr.sorted_ids[++i];
 	}
 
-	if (err) {
-		while (!SIMPLEQ_EMPTY(matched_ids)) {
-			struct got_object_qid *qid;
-			qid = SIMPLEQ_FIRST(matched_ids);
-			SIMPLEQ_REMOVE_HEAD(matched_ids, entry);
-			got_object_qid_free(qid);
-		}
-	}
+	if (err)
+		got_object_id_queue_free(matched_ids);
 	return err;
 }