projects
/
umurmur.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #101 from C4K3/bindport6
[umurmur.git]
/
src
/
voicetarget.c
diff --git
a/src/voicetarget.c
b/src/voicetarget.c
index d01b3e9bf025e0322ba02d2117037838df97d403..66de959ce30dbead14633b58b1c922984b6a72a2 100644
(file)
--- a/
src/voicetarget.c
+++ b/
src/voicetarget.c
@@
-1,5
+1,5
@@
-/* Copyright (C) 2009-201
1
, Martin Johansson <martin@fatbob.nu>
- Copyright (C) 2005-201
1
, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-201
4
, Martin Johansson <martin@fatbob.nu>
+ Copyright (C) 2005-201
4
, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
All rights reserved.
@@
-33,12
+33,13
@@
#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)
{
struct dlist *itr;
voicetarget_t *vt;
void Voicetarget_add_session(client_t *client, int targetId, int sessionId)
{
struct dlist *itr;
voicetarget_t *vt;
-
+
list_iterate(itr, &client->voicetargets) {
if (targetId == list_get_entry(itr, voicetarget_t, node)->id) {
int i;
list_iterate(itr, &client->voicetargets) {
if (targetId == list_get_entry(itr, voicetarget_t, node)->id) {
int i;
@@
-59,7
+60,7
@@
void Voicetarget_add_channel(client_t *client, int targetId, int channelId,
{
struct dlist *itr;
voicetarget_t *vt;
{
struct dlist *itr;
voicetarget_t *vt;
-
+
list_iterate(itr, &client->voicetargets) {
if (targetId == list_get_entry(itr, voicetarget_t, node)->id) {
int i;
list_iterate(itr, &client->voicetargets) {
if (targetId == list_get_entry(itr, voicetarget_t, node)->id) {
int i;
@@
-74,19
+75,16
@@
void Voicetarget_add_channel(client_t *client, int targetId, int channelId,
}
}
}
}
}
}
- }
+ }
}
void Voicetarget_add_id(client_t *client, int targetId)
{
voicetarget_t *newtarget;
int i;
}
void Voicetarget_add_id(client_t *client, int targetId)
{
voicetarget_t *newtarget;
int i;
-
+
Voicetarget_del_id(client, targetId);
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++)