Commit a9705505a48884d66efa5d535fff9d685b35808d

Stefan Sperling 2020-09-18T17:51:30

allow NULL pointer argument for got_free_gotconfig()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/gotconfig.c b/lib/gotconfig.c
index c52b0ab..d3c83b3 100644
--- a/lib/gotconfig.c
+++ b/lib/gotconfig.c
@@ -133,6 +133,9 @@ got_gotconfig_free(struct got_gotconfig *conf)
 {
 	int i;
 
+	if (conf == NULL)
+		return;
+
 	free(conf->author);
 
 	for (i = 0; i < conf->nremotes; i++) {