mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-19 07:00:03 -05:00
save errno before calling free()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2313 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
caf742a076
commit
b12b8ee160
1 changed files with 5 additions and 0 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <pulse/gccmacro.h>
|
#include <pulse/gccmacro.h>
|
||||||
#include <pulsecore/core-util.h>
|
#include <pulsecore/core-util.h>
|
||||||
|
|
@ -123,8 +124,12 @@ char *pa_xstrndup(const char *s, size_t l) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_xfree(void *p) {
|
void pa_xfree(void *p) {
|
||||||
|
int saved_errno;
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
saved_errno = errno;
|
||||||
free(p);
|
free(p);
|
||||||
|
errno = saved_errno;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue