diff options
Diffstat (limited to 'dbus/dbus-memory.c')
-rw-r--r-- | dbus/dbus-memory.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dbus/dbus-memory.c b/dbus/dbus-memory.c index 11489c78..14ce23d8 100644 --- a/dbus/dbus-memory.c +++ b/dbus/dbus-memory.c @@ -220,4 +220,28 @@ dbus_free (void *memory) free (memory); } +/** + * Frees a #NULL-terminated array of strings. + * If passed #NULL, does nothing. + * + * @param str_array the array to be freed + */ +void +dbus_free_string_array (char **str_array) +{ + if (str_array) + { + int i; + + i = 0; + while (str_array[i]) + { + dbus_free (str_array[i]); + i++; + } + + dbus_free (str_array); + } +} + /** @} */ |