X-Git-Url: http://git.code-monkey.de/?p=umurmur.git;a=blobdiff_plain;f=src%2Fvoicetarget.c;h=66de959ce30dbead14633b58b1c922984b6a72a2;hp=e2ed569c8f2db196c6d129404503a93355848e7d;hb=a1a0ba19a94a1bfe3c40629aa9c5f3a4b23db3ee;hpb=82e80f8f18cbb6fed903621751ba9751dc2b80a2 diff --git a/src/voicetarget.c b/src/voicetarget.c index e2ed569..66de959 100644 --- a/src/voicetarget.c +++ b/src/voicetarget.c @@ -33,6 +33,7 @@ #include #include "voicetarget.h" #include "log.h" +#include "memory.h" void Voicetarget_add_session(client_t *client, int targetId, int sessionId) { @@ -83,10 +84,7 @@ void Voicetarget_add_id(client_t *client, int targetId) int i; Voicetarget_del_id(client, targetId); - newtarget = malloc(sizeof(voicetarget_t)); - if (!newtarget) - Log_fatal("Out of memory"); - memset(newtarget, 0, sizeof(voicetarget_t)); + newtarget = Memory_safeCalloc(1, sizeof(voicetarget_t)); for (i = 0; i < TARGET_MAX_CHANNELS; i++) newtarget->channels[i].channel = -1; for (i = 0; i < TARGET_MAX_SESSIONS; i++)