summaryrefslogtreecommitdiffstats
path: root/common.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-28 15:32:04 +0000
committerRoy Marples <roy@marples.name>2008-01-28 15:32:04 +0000
commit7ab8b9f184628ec9bd7466df72e61d621185fa55 (patch)
treee10c07f2f31506f7082a158acf3db82a2170f5a0 /common.c
parent36c01cf227ef87707950b60d6feccb5098a73b01 (diff)
downloaddhcpcd-7ab8b9f184628ec9bd7466df72e61d621185fa55.tar.xz
Introduce xzalloc, which zeros memory as well as allocates it. This makes us smaller.
Diffstat (limited to 'common.c')
-rw-r--r--common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common.c b/common.c
index 14e88541..161b891e 100644
--- a/common.c
+++ b/common.c
@@ -204,6 +204,13 @@ void *xmalloc (size_t s)
/* NOTREACHED */
}
+void *xzalloc (size_t s)
+{
+ void *value = xmalloc (s);
+ memset (value, 0, s);
+ return (value);
+}
+
void *xrealloc (void *ptr, size_t s)
{
void *value = realloc (ptr, s);