Commit 32f0ab8169fd024eab0a430b7dd5735856114645

Hiltjo Posthuma 2019-08-27T18:59:01

match_object_id: fix free() in error handling path

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/got/got.c b/got/got.c
index 74616cf..b9cfd91 100644
--- a/got/got.c
+++ b/got/got.c
@@ -2035,7 +2035,7 @@ match_object_id(struct got_object_id **id, char **label,
 			else if (asprintf(label, "refs/tags/%s",
 			    got_object_tag_get_name(tag)) == -1) {
 				err = got_error_from_errno("asprintf");
-				free(id);
+				free(*id);
 				*id = NULL;
 			}
 			got_object_tag_close(tag);