[155] in bug-owl

home help back first fref pref prev next nref lref last post

Re: memory leak

daemon@ATHENA.MIT.EDU (James M. Kretchmar)
Fri Mar 21 11:50:32 2003

Message-Id: <200303211650.LAA07812@mission-control.mit.edu>
To: Jeremy Daniel <jdaniel@MIT.EDU>
cc: bug-owl@MIT.EDU
In-Reply-To: Your message of "18 Mar 2003 00:37:48 EST."
             <ske8yvdw7yr.fsf@multics.mit.edu> 
Date: Fri, 21 Mar 2003 11:50:30 -0500
From: "James M. Kretchmar" <kretch@MIT.EDU>

> I think there's a free missing from the second half of the if in here.
> I moved the relevant one in the first half outside since the malloc is
> also outside.

Good catch.

kretch

> > cvs diff -u message.c
> Index: message.c
> ===================================================================
> RCS file: /mit/ktools/src/owl/repository/owl/message.c,v
> retrieving revision 1.21
> diff -u -r1.21 message.c
> --- message.c   25 Feb 2003 17:56:22 -0000      1.21
> +++ message.c   18 Mar 2003 05:28:39 -0000
> @@ -471,12 +471,12 @@
>    if (owl_global_is_newlinestrip(&g)) {
>      tmp2=owl_util_stripnewlines(tmp);
>      owl_message_set_body(m, tmp2);
> -    owl_free(tmp);
>      owl_free(tmp2);
>    } else {
>      owl_message_set_body(m, tmp);
>    }
> -
> +  owl_free(tmp);
> +
>    /* if zcrypt is enabled try to decrypt the message */
>    if (owl_global_is_zcrypt(&g) && !strcasecmp(n->z_opcode, "crypt")) {
>      char *out;
> 
> -- 

home help back first fref pref prev next nref lref last post