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:
parent
b42a542858
commit
4799df9efb
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
typedef struct _MyInput {
|
typedef struct _MyInput {
|
||||||
const char *filename;
|
const char *filename;
|
||||||
const unsigned char *contents;
|
unsigned char *contents;
|
||||||
size_t length;
|
size_t length;
|
||||||
size_t read_position;
|
size_t read_position;
|
||||||
} MyInput;
|
} MyInput;
|
||||||
@ -106,7 +106,7 @@ main( int argc, char **argv )
|
|||||||
VipsTargetCustom *target_custom;
|
VipsTargetCustom *target_custom;
|
||||||
VipsImage *image;
|
VipsImage *image;
|
||||||
|
|
||||||
if( VIPS_INIT( NULL ) )
|
if( VIPS_INIT( argv[0] ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
if( argc != 3 )
|
if( argc != 3 )
|
||||||
@ -153,6 +153,7 @@ main( int argc, char **argv )
|
|||||||
VIPS_UNREF( image );
|
VIPS_UNREF( image );
|
||||||
VIPS_UNREF( source_custom );
|
VIPS_UNREF( source_custom );
|
||||||
VIPS_UNREF( target_custom );
|
VIPS_UNREF( target_custom );
|
||||||
|
g_free( my_input.contents );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user