summaryrefslogtreecommitdiff
path: root/source4/lib/util_strlist.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-03 06:42:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:19 -0500
commite5ce904ddbd6175ba86ed827bf096b76b11b5511 (patch)
tree722b04d001e9b26bb47b2480fef13699a0366667 /source4/lib/util_strlist.c
parent7dcfd94f817d1c12a14704cbb96604dc3074aa2e (diff)
downloadsamba-e5ce904ddbd6175ba86ed827bf096b76b11b5511.tar.gz
samba-e5ce904ddbd6175ba86ed827bf096b76b11b5511.tar.bz2
samba-e5ce904ddbd6175ba86ed827bf096b76b11b5511.zip
r4054: got rid of Realloc(), replacing it with the type safe macro realloc_p()
(This used to be commit b0f6e21481745d1b2ced28d9ed6f09f6ffd99562)
Diffstat (limited to 'source4/lib/util_strlist.c')
-rw-r--r--source4/lib/util_strlist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/util_strlist.c b/source4/lib/util_strlist.c
index a9198031a1..33f824dcf8 100644
--- a/source4/lib/util_strlist.c
+++ b/source4/lib/util_strlist.c
@@ -53,7 +53,7 @@ char **str_list_make(const char *string, const char *sep)
while (next_token(&str, tok, sep, sizeof(tok))) {
if (num == lsize) {
lsize += S_LIST_ABS;
- rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1)));
+ rlist = realloc_p(list, char *, lsize + 1);
if (!rlist) {
DEBUG(0,("str_list_make: Unable to allocate memory"));
str_list_free(&list);
@@ -94,7 +94,7 @@ BOOL str_list_copy(char ***dest, const char **src)
while (src[num]) {
if (num == lsize) {
lsize += S_LIST_ABS;
- rlist = (char **)Realloc(list, ((sizeof(char **)) * (lsize +1)));
+ rlist = realloc_p(list, char *, lsize + 1);
if (!rlist) {
DEBUG(0,("str_list_copy: Unable to re-allocate memory"));
str_list_free(&list);
@@ -302,7 +302,7 @@ int ipstr_list_parse(const char* ipstr_list, struct ipv4_addr** ip_list)
break;
/* prepare place for another in_addr structure */
- *ip_list = Realloc(*ip_list, (count + 1) * sizeof(struct ipv4_addr));
+ *ip_list = realloc_p(*ip_list, struct ipv4_addr, count + 1);
if (!*ip_list) return -1;
(*ip_list)[count] = addr;