Skip to Content.
Sympa Menu

freetds - RE: re-use of dbprocess structure (was: Re: [freetds]stateofdbrpcsend())

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: re-use of dbprocess structure (was: Re: [freetds]stateofdbrpcsend())
  • Date: Mon, 12 Jul 2004 10:33:44 +0200

>
> > Yes, this clear some things. Can you post entire code (with
> source store
> > procedure if you can) so I can try to reproduce it ?
>
> Attached is a stand-alone test program and stored procedure that
> illustrates the memory leak.
>
> Thanks.
>

This patch should solve your problem.

Index: src/dblib/rpc.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/dblib/rpc.c,v
retrieving revision 1.28
diff -u -1 -0 -r1.28 rpc.c
--- src/dblib/rpc.c 8 Jul 2004 09:41:37 -0000 1.28
+++ src/dblib/rpc.c 12 Jul 2004 08:22:01 -0000
@@ -364,13 +364,14 @@
param_clear(DBREMOTE_PROC_PARAM * pparam)
{
if (pparam == NULL)
return;

if (pparam->next) {
param_clear(pparam->next);
}

/* free self after clearing children */
+ if (pparam->name)
+ free(pparam->name);
free(pparam);
- pparam = (DBREMOTE_PROC_PARAM *) NULL;
}

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page