Commit 3ea6b476 by Neil Booth Committed by Jeff Law

prefix.c (concat, lookup_key): Use xmalloc and xrealloc consistently.

        * prefix.c (concat, lookup_key): Use xmalloc and xrealloc
        consistently.

From-SVN: r31958
parent 445ab443
Sun Feb 13 12:57:52 2000 Neil Booth <NeilB@earthling.net>
* prefix.c (concat, lookup_key): Use xmalloc and xrealloc
consistently.
2000-02-13 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* flow.c (flow_loop_tree_node_add): Use better algorithm by passing
......
......@@ -139,7 +139,7 @@ concat VPARAMS ((const char *first, ...))
arg = va_arg (args, const char *);
}
newstr = (char *) malloc (length + 1);
newstr = (char *) xmalloc (length + 1);
va_end (args);
/* Now copy the individual pieces to the result string. */
......@@ -211,12 +211,12 @@ lookup_key (key)
}
size = 32;
dst = (char *) malloc (size);
dst = (char *) xmalloc (size);
res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
if (res == ERROR_MORE_DATA && type == REG_SZ)
{
dst = (char *) realloc (dst, size);
dst = (char *) xrealloc (dst, size);
res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment