Skip to content

Commit

Permalink
Plug memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
wjk committed Nov 27, 2018
1 parent 93d9282 commit 0ef0e45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libxpc/xpc_private.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ xpc_object_t xpc_copy_entitlements_for_pid(pid_t pid) {
required_length = ntohl(required_length);

if (required_length != 0) {
char *blob = calloc(1, required_length);
char *blob = alloca(required_length);
ret = csops(pid, CS_OPS_ENTITLEMENTS_BLOB, blob, required_length);
if (ret == -1) {
return NULL;
Expand Down

0 comments on commit 0ef0e45

Please sign in to comment.