Commit c3b78ecc086674ea6d62c9239aa96ee4f8bffe3a

Stefan Sperling 2018-11-07T08:24:04

no need to zero tree during allocation in got_privsep_recv_tree()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/lib/privsep.c b/lib/privsep.c
index 9bc6085..43c618f 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -710,13 +710,14 @@ get_more:
 				break;
 			}
 			itree = imsg.data;
-			*tree = calloc(1, sizeof(**tree));
+			*tree = malloc(sizeof(**tree));
 			if (*tree == NULL) {
 				err = got_error_from_errno();
 				break;
 			}
 			(*tree)->entries.nentries = itree->nentries;
 			SIMPLEQ_INIT(&(*tree)->entries.head);
+			(*tree)->refcnt = 0;
 			break;
 		case GOT_IMSG_TREE_ENTRY:
 			/* This message should be preceeded by GOT_IMSG_TREE. */