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
This commit is contained in:
John Cupitt 2020-10-27 15:11:29 +00:00
parent b42a542858
commit 4799df9efb
1 changed files with 3 additions and 2 deletions

View File

@ -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 );
}