From 4799df9efb8421749c97cdbb7b4796e1739d7fef Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 27 Oct 2020 15:11:29 +0000 Subject: [PATCH] fix two small bugs in test_connections.c We were passing NULL rather than argv0 to VIPS_INIT(), and we were not freeing the loaded file. thanks zodf0055980 see https://github.com/libvips/libvips/issues/1867 --- test/test_connections.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_connections.c b/test/test_connections.c index 61366b06..d59571c5 100644 --- a/test/test_connections.c +++ b/test/test_connections.c @@ -10,7 +10,7 @@ typedef struct _MyInput { const char *filename; - const unsigned char *contents; + unsigned char *contents; size_t length; size_t read_position; } MyInput; @@ -106,7 +106,7 @@ main( int argc, char **argv ) VipsTargetCustom *target_custom; VipsImage *image; - if( VIPS_INIT( NULL ) ) + if( VIPS_INIT( argv[0] ) ) return( -1 ); if( argc != 3 ) @@ -153,6 +153,7 @@ main( int argc, char **argv ) VIPS_UNREF( image ); VIPS_UNREF( source_custom ); VIPS_UNREF( target_custom ); + g_free( my_input.contents ); return( 0 ); }