summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-06-17 03:13:01 +0200
committerLennart Poettering <lennart@poettering.net>2009-06-17 03:13:01 +0200
commitc5dbf754b578d70d5bf01494fedad74c1829ac38 (patch)
treeee95bb79b93b9f1b7153c91d21b5d0d44fe1f642 /src
parent7de7b012fd991100abcd031ed06005911cfea8cd (diff)
core-util: implement pa_xstrfreev()
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/core-util.c12
-rw-r--r--src/pulsecore/core-util.h6
2 files changed, 18 insertions, 0 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index b747cd84..0b64edba 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -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);
+}
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index d073b750..5a12ad3f 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -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