mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-18 06:59:57 -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 <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <pulse/gccmacro.h>
|
||||
#include <pulsecore/core-util.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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue