[Yazlist] Possible Memory Leak

Adam Dickmeiss adam at indexdata.dk
Sun Jul 30 15:19:35 CEST 2006


Linux Godfather wrote:
> Dear list,
> 
> there is a possible 12 bytes memory leak inside ZOOM_resultset_records
> 
> attached is c program that reproduce the leak.
> also i attached valgrind output.
> 
We are unable to reproduce this. Version of YAZ?

If the server could be made available so that we can use the test 
program exactly as it is,.. it'd be nice.

/ Adam

> Regards,
> 
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> #include <yaz/zoom.h>
> #include <stdio.h>
> 
> int main()
> {
> 	ZOOM_options o = ZOOM_options_create ();
> 	ZOOM_options_set (o, "databaseName", "testdb");
> 	ZOOM_options_set (o, "start", "0");
> 	ZOOM_options_set (o, "count", "10");
> 	ZOOM_options_set (o, "preferredRecordSyntax", "XML");
> 
> 	ZOOM_connection z = ZOOM_connection_create (o);
> 	ZOOM_connection_connect(z, "test_server.bigcluster10.com", 9005);
> 	ZOOM_resultset r = ZOOM_connection_search_pqf (z, "@attr 2=102 test" );
> 	
> 	int error;
> 	const char *errmsg, *addinfo;
> 	if ( (error = ZOOM_connection_error(z, &errmsg, &addinfo)) )
> 		fprintf (stderr, "error: %s (%d) %s\n",  errmsg, error, addinfo);
> 	else
> 	{
> 		int hits = ZOOM_resultset_size(r);
> 		int pos;
> 		int len;
> 		printf ("%d hits\n", hits);
> 		ZOOM_record recs[10];
> 		ZOOM_resultset_records (r, recs, 0, 10);
> 		
> 		for (pos = 0; pos < 10 && pos < hits; pos++)
> 		{
> 			const char *render = ZOOM_record_get (recs[pos], "render", &len);
> 			// handle the hit
> 		}
> 		
> 		
> 	}
> 	
> 	ZOOM_resultset_destroy(r);
> 	ZOOM_options_destroy(o);
> 	ZOOM_connection_destroy(z);
> 	
> 	return 0;
> }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Yazlist mailing list
> Yazlist at lists.indexdata.dk
> http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist




More information about the Yazlist mailing list