projects
/
umurmur.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use Client_find_by_session() instead of a few open-coded loops.
[umurmur.git]
/
src
/
voicetarget.c
diff --git
a/src/voicetarget.c
b/src/voicetarget.c
index e2ed569c8f2db196c6d129404503a93355848e7d..66de959ce30dbead14633b58b1c922984b6a72a2 100644
(file)
--- a/
src/voicetarget.c
+++ b/
src/voicetarget.c
@@
-33,6
+33,7
@@
#include <string.h>
#include "voicetarget.h"
#include "log.h"
#include <string.h>
#include "voicetarget.h"
#include "log.h"
+#include "memory.h"
void Voicetarget_add_session(client_t *client, int targetId, int sessionId)
{
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);
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++)
for (i = 0; i < TARGET_MAX_CHANNELS; i++)
newtarget->channels[i].channel = -1;
for (i = 0; i < TARGET_MAX_SESSIONS; i++)