From b12b8ee16071305cc0686a0d8130f958742a5078 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 1 May 2008 18:56:14 +0000 Subject: save errno before calling free() git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2313 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulse/xmalloc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pulse/xmalloc.c b/src/pulse/xmalloc.c index 28490975..a64761bf 100644 --- a/src/pulse/xmalloc.c +++ b/src/pulse/xmalloc.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -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; } -- cgit