diff --git a/libvips/foreign/pdfload.c b/libvips/foreign/pdfload.c index 78edc9b6..9172dda4 100644 --- a/libvips/foreign/pdfload.c +++ b/libvips/foreign/pdfload.c @@ -406,11 +406,11 @@ vips_foreign_load_pdf_file_header( VipsForeignLoad *load ) */ path = vips_realpath( file->filename ); if( !(file->uri = g_filename_to_uri( path, NULL, &error )) ) { - free( path ); + g_free( path ); vips_g_error( &error ); return( -1 ); } - free( path ); + g_free( path ); if( !(pdf->doc = poppler_document_new_from_file( file->uri, NULL, &error )) ) { diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c index da1d021e..bffc0aa8 100644 --- a/libvips/iofuncs/util.c +++ b/libvips/iofuncs/util.c @@ -1750,7 +1750,7 @@ vips_realpath( const char *path ) char *cwd; cwd = g_get_current_dir(); - real = g_build_filename( cwd, path ); + real = g_build_filename( cwd, path, NULL ); g_free( cwd ); } else