projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e18f44
)
teamspeak2: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:24:23 +0000
(18:24 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:24:23 +0000
(18:24 +0200)
src/teamspeak2.c
patch
|
blob
|
history
diff --git
a/src/teamspeak2.c
b/src/teamspeak2.c
index
345f57e
..
263863b
100644
(file)
--- a/
src/teamspeak2.c
+++ b/
src/teamspeak2.c
@@
-83,13
+83,12
@@
static int tss2_add_vserver (int vserver_port)
}
/* Allocate memory */
- entry =
malloc (
sizeof (*entry));
+ entry =
calloc (1,
sizeof (*entry));
if (entry == NULL)
{
- ERROR ("teamspeak2 plugin:
m
alloc failed.");
+ ERROR ("teamspeak2 plugin:
c
alloc failed.");
return (-1);
}
- memset (entry, 0, sizeof (vserver_list_t));
/* Save data */
entry->port = vserver_port;