api_clear_error: Skip if error was not set.

This commit is contained in:
Justin M. Keyes
2017-04-23 16:43:07 +02:00
parent 2a49163103
commit 62c3f436a9

View File

@@ -803,6 +803,9 @@ void api_free_dictionary(Dictionary value)
void api_clear_error(Error *value)
FUNC_ATTR_NONNULL_ALL
{
if (!value->set) {
return;
}
xfree(value->msg);
value->msg = NULL;
}