From a0e37e779ddd35f3ea60f375f218a917c37fb605 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 20 Oct 2011 01:41:02 +0400 Subject: [PATCH] util: Add xstrdup helper Signed-off-by: Cyrill Gorcunov --- include/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/util.h b/include/util.h index e8aaa93d7..32f6d135a 100644 --- a/include/util.h +++ b/include/util.h @@ -159,6 +159,7 @@ int close_safe(int *fd); ___p; \ }) +#define xstrdup(str) __xalloc(strdup, strlen(str) + 1, str) #define xmalloc(size) __xalloc(malloc, size, size) #define xzalloc(size) __xalloc(calloc, size, 1, size) #define xrealloc(p, size) __xalloc(realloc, size, p, size)