Fix a memory leak

Coverity flagged this minor memory leak.
This commit is contained in:
Matthias Clasen 2024-06-24 14:16:28 -04:00
parent b807b7a87a
commit dd40d34fee

View file

@ -2831,8 +2831,10 @@ _cairo_pdf_interchange_set_custom_metadata (cairo_pdf_surface_t *surface,
if (value && strlen(value)) {
new_data.name = strdup (name);
status = _cairo_utf8_to_pdf_string (value, &s);
if (unlikely (status))
if (unlikely (status)) {
free (new_data.name);
return status;
}
new_data.value = s;
status = _cairo_array_append (&ic->custom_metadata, &new_data);
}