From e5ce904ddbd6175ba86ed827bf096b76b11b5511 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 3 Dec 2004 06:42:06 +0000 Subject: r4054: got rid of Realloc(), replacing it with the type safe macro realloc_p() (This used to be commit b0f6e21481745d1b2ced28d9ed6f09f6ffd99562) --- source4/lib/util_strlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib/util_strlist.c') 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; -- cgit