Commit 6a38f512 authored by Nikias Bassen's avatar Nikias Bassen

bplist: Fix memory leaking caused by unused nodes in plist_from_bin()

parent df053ccd
......@@ -715,6 +715,15 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist)
}
*plist = nodeslist[root_object];
// free unreferenced nodes that would otherwise leak memory
for (i = 0; i < num_objects; i++) {
if (i == root_object) continue;
node_t* node = (node_t*)nodeslist[i];
if (NODE_IS_ROOT(node)) {
plist_free(node);
}
}
free(nodeslist);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment