While GLib mentions that this method is nullable[0][1] (i.e., can be passed
and can return null) its use of the, a bit misleading,
g_return_val_if_fail[2] voids that, as passing NULL emits an
warning[2] which looks pretty grave (assertion failure), albeit is
just noise..
[0]: https://developer.gnome.org/glib/stable/glib-Strings.html#g-string-free
[1]: https://salsa.debian.org/gnome-team/glib/blob/debian/2.58.3-2/glib/gstring.c#L196
[2]: https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions.html#g-return-val-if-fail
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
}
ret:
g_free(tmp);
- g_string_free(path, TRUE);
+ if (path != NULL) {
+ g_string_free(path, TRUE);
+ }
g_string_append_printf(str,"\n}\n");
g_mutex_unlock (&mutex);