diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-05-15 23:34:41 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-05-15 23:34:41 +0000 |
commit | 045c1d602dcba57868845ba3270510593c39480f (patch) | |
tree | b3d61f180e6fa40f97a80aa3e46d7c910ed7c2a6 /src/pulse/xmalloc.c | |
parent | 91f092eadcc5e9075e04ae42df11de28ef5047a8 (diff) |
merge glitch-free branch back into trunk
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2445 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulse/xmalloc.c')
-rw-r--r-- | src/pulse/xmalloc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pulse/xmalloc.c b/src/pulse/xmalloc.c index 5348dda4..a64761bf 100644 --- a/src/pulse/xmalloc.c +++ b/src/pulse/xmalloc.c @@ -29,9 +29,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 +124,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; } |