X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flibcollectdclient%2Fclient.c;h=aeb8f22ae7952334094e1cee4ce60f9394611cb3;hb=1ebf2f31bd2e080e6f42de640f0a3899a61501c0;hp=77819c217b6e8ae1272415974f88480ab17710b0;hpb=6894d846ac42cbe88073db074d75279f5a6e31b8;p=collectd.git diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index 77819c21..aeb8f22a 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -312,7 +312,7 @@ static int lcc_receive (lcc_connection_t *c, /* {{{ */ /* Allocate space for the char-pointers */ res.lines_num = (size_t) res.status; res.status = 0; - res.lines = (char **) malloc (res.lines_num * sizeof (char *)); + res.lines = malloc (res.lines_num * sizeof (*res.lines)); if (res.lines == NULL) { lcc_set_errno (c, ENOMEM); @@ -584,7 +584,7 @@ int lcc_connect (const char *address, lcc_connection_t **ret_con) /* {{{ */ if (ret_con == NULL) return (-1); - c = (lcc_connection_t *) malloc (sizeof (*c)); + c = malloc (sizeof (*c)); if (c == NULL) return (-1); memset (c, 0, sizeof (*c)); @@ -687,7 +687,7 @@ int lcc_getval (lcc_connection_t *c, lcc_identifier_t *ident, /* {{{ */ /* Allocate space for the values */ if (ret_values != NULL) { - values = (gauge_t *) malloc (values_num * sizeof (*values)); + values = malloc (values_num * sizeof (*values)); if (values == NULL) BAIL_OUT (ENOMEM); } @@ -894,7 +894,7 @@ int lcc_listval (lcc_connection_t *c, /* {{{ */ } ident_num = res.lines_num; - ident = (lcc_identifier_t *) malloc (ident_num * sizeof (*ident)); + ident = malloc (ident_num * sizeof (*ident)); if (ident == NULL) { lcc_response_free (&res);