test: Free resources in pdf2png

Patch proposed by Bofa.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/issues/317
Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
This commit is contained in:
Bryce Harrington 2018-10-17 17:51:14 -07:00
parent 3a03c1ba4b
commit 6059f5f260

View file

@ -67,10 +67,12 @@ int main (int argc, char *argv[])
FAIL (error->message);
document = poppler_document_new_from_file (uri, NULL, &error);
g_free (uri);
if (document == NULL)
FAIL (error->message);
page = poppler_document_get_page_by_label (document, page_label);
g_object_unref (document);
if (page == NULL)
FAIL ("page not found");