Skip to content

Commit

Permalink
Merge pull request #6 from reqshark/globalfix
Browse files Browse the repository at this point in the history
fix regression in global.c
  • Loading branch information
reqshark committed May 2, 2015
2 parents 9e88ff3 + fb1f913 commit 176fc72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions core/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,7 @@ void *nn_reallocmsg (void *msg, size_t size)

int nn_freemsg (void *msg)
{
if (msg != NULL) {
nn_chunk_free (msg);
}
return 0;
}

Expand Down Expand Up @@ -469,7 +467,7 @@ struct nn_cmsghdr *nn_cmsg_nxthdr_ (const struct nn_msghdr *mhdr,
if (headsz + sizeof (struct nn_cmsghdr) > sz ||
headsz + NN_CMSG_SPACE (next->cmsg_len) > sz)
return NULL;

/* Success. */
return next;
}
Expand Down
4 changes: 2 additions & 2 deletions utils/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void *nn_alloc_ (size_t size, const char *name)
{
uint8_t *chunk;

chunk = calloc (sizeof (struct nn_alloc_hdr) + size, sizeof(uint8_t));
chunk = malloc (sizeof (struct nn_alloc_hdr) + size);
if (!chunk)
return NULL;

Expand Down Expand Up @@ -131,7 +131,7 @@ void nn_alloc_term (void)

void *nn_alloc_ (size_t size)
{
return calloc (size, sizeof(uint8_t));
return malloc (size);
}

void *nn_realloc (void *ptr, size_t size)
Expand Down

0 comments on commit 176fc72

Please sign in to comment.