]> code.delx.au - pulseaudio/commitdiff
core-util: implement pa_xstrfreev()
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Jun 2009 01:13:01 +0000 (03:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Jun 2009 01:13:01 +0000 (03:13 +0200)
src/pulsecore/core-util.c
src/pulsecore/core-util.h

index b747cd8481c6f92f82c4c48a952ffeb71c1d6cfc..0b64edbab88a9c136af24a580dde345c7abd02ae 100644 (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);
+}
index d073b750fbb9aa1ed660eae0749f09c1f1fc6618..5a12ad3fe9f5958f381788a9aa4858d0be821366 100644 (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