projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treewide: cleanup malloc calls
[collectd.git]
/
src
/
daemon
/
common.c
diff --git
a/src/daemon/common.c
b/src/daemon/common.c
index
dd4f9b1
..
2f6da95
100644
(file)
--- a/
src/daemon/common.c
+++ b/
src/daemon/common.c
@@
-144,7
+144,7
@@
char *sstrdup (const char *s)
/* Do not use `strdup' here, because it's not specified in POSIX. It's
* ``only'' an XSI extension. */
sz = strlen (s) + 1;
/* Do not use `strdup' here, because it's not specified in POSIX. It's
* ``only'' an XSI extension. */
sz = strlen (s) + 1;
- r =
(char *) malloc (sizeof (char) *
sz);
+ r =
malloc (
sz);
if (r == NULL)
{
ERROR ("sstrdup: Out of memory.");
if (r == NULL)
{
ERROR ("sstrdup: Out of memory.");
@@
-409,7
+409,7
@@
int escape_string (char *buffer, size_t buffer_size)
if (buffer_size < 3)
return (EINVAL);
if (buffer_size < 3)
return (EINVAL);
- temp =
(char *)
malloc (buffer_size);
+ temp = malloc (buffer_size);
if (temp == NULL)
return (ENOMEM);
memset (temp, 0, buffer_size);
if (temp == NULL)
return (ENOMEM);
memset (temp, 0, buffer_size);