core-util: implement pa_xstrfreev()

This commit is contained in:
Lennart Poettering 2009-06-17 03:13:01 +02:00
parent 7de7b012fd
commit c5dbf754b5
2 changed files with 18 additions and 0 deletions

View file

@ -2732,3 +2732,15 @@ void pa_disable_sigpipe(void) {
}
#endif
}
void pa_xfreev(void**a) {
void **p;
if (!a)
return;
for (p = a; *p; p++)
pa_xfree(*p);
pa_xfree(a);
}

View file

@ -229,4 +229,10 @@ char *pa_realpath(const char *path);
void pa_disable_sigpipe(void);
void pa_xfreev(void**a);
static inline void pa_xstrfreev(char **a) {
pa_xfreev((void**) a);
}
#endif