diff options
Diffstat (limited to 'src/pulse/xmalloc.c')
-rw-r--r-- | src/pulse/xmalloc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pulse/xmalloc.c b/src/pulse/xmalloc.c index 5348dda4..90237013 100644 --- a/src/pulse/xmalloc.c +++ b/src/pulse/xmalloc.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -29,9 +27,10 @@ #include <signal.h> #include <unistd.h> #include <string.h> +#include <errno.h> +#include <pulse/gccmacro.h> #include <pulsecore/core-util.h> -#include <pulsecore/gccmacro.h> #include <pulsecore/macro.h> #include "xmalloc.h" @@ -123,8 +122,12 @@ char *pa_xstrndup(const char *s, size_t l) { } void pa_xfree(void *p) { + int saved_errno; + if (!p) return; + saved_errno = errno; free(p); + errno = saved_errno; } |