Skip to content

Commit

Permalink
removed use of calloc
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyPork committed Mar 22, 2016
1 parent cfb6291 commit 3b4bb35
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/sbmp_session.c
Expand Up @@ -106,11 +106,14 @@ bool sbmp_ep_init_listeners(SBMP_Endpoint *ep, SBMP_SessionListenerSlot *listene
if (listener_slots == NULL && slot_count > 0) {
// request to allocate it
#if SBMP_MALLOC
// calloc -> make sure all listeners are NULL = unused
listener_slots = calloc(slot_count, sizeof(SBMP_SessionListenerSlot));
listener_slots = malloc(slot_count * sizeof(SBMP_SessionListenerSlot));
if (!listener_slots) { // malloc failed
return false;
}
//zero out (no calloc?)
for (int i = 0; i < slot_count; i++) {
listener_slots[i].callback = NULL;
}
#else
return false;
#endif
Expand Down

0 comments on commit 3b4bb35

Please sign in to comment.