libnm: fix leak in nm_utils_is_json_object()

Fixes: 32f78ae6c3 ('libnm: expose nm_utils_is_json_object() utility function')
(cherry picked from commit 1cf11ccbca)
This commit is contained in:
Thomas Haller 2020-06-14 23:44:53 +02:00
parent 12e4a4a5df
commit 49ec86092b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -5428,7 +5428,7 @@ gboolean
nm_utils_is_json_object (const char *str, GError **error)
{
#if WITH_JSON_VALIDATION
json_t *json;
nm_auto_decref_json json_t *json = NULL;
json_error_t jerror;
g_return_val_if_fail (!error || !*error, FALSE);
@ -5465,7 +5465,6 @@ nm_utils_is_json_object (const char *str, GError **error)
return FALSE;
}
json_decref (json);
return TRUE;
#else /* !WITH_JSON_VALIDATION */
g_return_val_if_fail (!error || !*error, FALSE);