|
List Info
Thread: Possible Memory Leak
|
|
| Possible Memory Leak |

|
2006-07-30 13:19:35 |
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 lists.indexdata.dk
> http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yaz
list
_______________________________________________
Yazlist mailing list
Yazlist lists.indexdata.dk
http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yaz
list
|
|
| Possible Memory Leak |

|
2006-08-22 08:34:00 |
|
sorry it was an old release (2.1.8), i was counting one some one else to install latest version, but it seems he installed an old release.
after updating to latest Yaz version 2.1.26 (No Memory Leak).
Thanks.
On 7/30/06, Adam Dickmeiss <indexdata.dk">adam indexdata.dk> wrote:
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_optio | |