[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Corrected some memory leacs in src/tests/run_test.c

From: Rui Batista
Subject: [PATCH] Corrected some memory leacs in src/tests/run_test.c
Date: Tue, 16 Feb 2010 19:48:22 +0000

Ter, 2010-02-16 ?s 13:30 -0600, Chris Brannon escreveu:
> Rui Batista wrote:
> > In send_data a reply buffer was being alocated and never freeed, even if 
> > not 
> > needed. The reply buffers alocated in send_data should be freeed in main 
> > too,
> >  like the line buffer. This commit address also these changes.
> > ---
> Cool!  There are a couple problems with your patch, as it stands.
> send_data can return "", AKA the empty string.
> You better not free that, because it isn't heap-allocated!
> I'd replace the return "" in send_data with this:
> reply[0] = '\0'; /* We're returning the empty string. */
> Next, send_data might have returned NULL, so you need to check for that
> before you use or free it.
> -- Chris
> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd
Rui Batista
E-mail/googletalk: ruiandrebatista (at) gmail (dot) com
MSN/WLM: ruiandrebatista (at) hotmail (dot) com (don't send mail to this
Skype: ruiandrebatista
twitter: http://twitter.com/ragb
weblog: http://outputstream.wordpress.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]