[162] in Hesiod
Re: Major memory leak in hes_resolv
daemon@ATHENA.MIT.EDU (Dean Anderson)
Mon Oct 11 10:56:05 1993
To: tytso@MIT.EDU (Theodore Ts'o)
Cc: mcb@mach.eng.hou.compaq.com, hesiod@MIT.EDU,
In-Reply-To: Your message of "Fri, 08 Oct 1993 19:10:57 EDT."
Date: Mon, 11 Oct 1993 10:52:42 EDT
From: Dean Anderson <dean@ksr.com>
>It's actually a feature, since if a program nees to call hes_resolve
>multiple times to get various different pieces of information, it
>doesn't need to copy the returned information to a another variable
Actually, if you do not have the following patch to hesiod.c, you
still cannot call it multiple times without copying the data. Of
course, the user program must also free the retvec too.
This includes changing to IN class records (lines 180, and 191), which
makes nameserver configuration a lot easier. I still have a ns.ksr.com
domain, which contains my hesiod data.
--Dean
-------------------------------------------
diff -r1.3 hesiod.c
3c3
< * $Source: /cf/src/src/misc/hesiod/hesiod/RCS/hesiod.c,v $
---
> * $Source: /u1/src/misc/hesiod/hesiod/RCS/hesiod.c,v $
52c52
< static char rcsid_hesiod_c[] = "$Header: /cf/src/src/misc/hesiod/hesiod/RCS/hesiod.c,v 1.3 1990/03/06 12:48:28 mar Exp dean $";
---
> static char rcsid_hesiod_c[] = "$Header: /u1/src/misc/hesiod/hesiod/RCS/hesiod.c,v 1.3 1990/03/06 12:48:28 mar Exp dean $";
169c169
< static char *retvec[100];
---
> char **retvec = (char **) calloc(sizeof(char *), 100);
180c180
< ns = _resolve(cp, C_HS, T_TXT, NoRetryTime);
---
> ns = _resolve(cp, C_IN, T_TXT, NoRetryTime);
191c191
< rp->class == C_HS &&
---
> rp->class == C_IN &&