Commit aa0926921193099319156437044e75e4b7b702e1

Stefan Sperling 2020-07-23T14:22:40

initialize output parameter of got_object_blob_read_to_str(); found by ofree

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object.c b/lib/object.c
index 102953c..b840da1 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -869,6 +869,8 @@ got_object_blob_read_to_str(char **s, struct got_blob_object *blob)
 	const struct got_error *err = NULL;
 	size_t len, totlen, hdrlen, offset;
 
+	*s = NULL;
+
 	hdrlen = got_object_blob_get_hdrlen(blob);
 	totlen = 0;
 	offset = 0;