Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: msnyder@sonic.net
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] c-exp.y, memory leak
Date: Sun, 05 Aug 2007 18:52:00 -0000	[thread overview]
Message-ID: <200708051852.l75Iq0Du032483@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <9892.12.7.175.2.1186278669.squirrel@webmail.sonic.net> 	(msnyder@sonic.net)

> Date: Sat, 4 Aug 2007 18:51:09 -0700 (PDT)
> From: msnyder@sonic.net
> 
> 2007-08-04  Michael Snyder  <msnyder@access-company.com>
> 
> 	* c-exp.y (parse_number): Memory leak.

Shouldn't this use xfree()?

> Index: c-exp.y
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-exp.y,v
> retrieving revision 1.38
> diff -p -r1.38 c-exp.y
> *** c-exp.y	12 Jun 2007 15:33:03 -0000	1.38
> --- c-exp.y	5 Aug 2007 01:49:51 -0000
> *************** parse_number (p, len, parsed_float, puti
> *** 1096,1104 ****
>   	    putithere->typed_val_float.type = 
>   	      builtin_type (current_gdbarch)->builtin_long_double;
>   	  else
> ! 	    return ERROR;
>   	}
>   
>         return FLOAT;
>       }
>   
> --- 1096,1108 ----
>   	    putithere->typed_val_float.type = 
>   	      builtin_type (current_gdbarch)->builtin_long_double;
>   	  else
> ! 	    {
> ! 	      free (s);
> ! 	      return ERROR;
> ! 	    }
>   	}
>   
> +       free (s);
>         return FLOAT;
>       }


  reply	other threads:[~2007-08-05 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05  1:51 msnyder
2007-08-05 18:52 ` Mark Kettenis [this message]
2007-08-05 22:08   ` Michael Snyder
2007-08-10 22:29   ` msnyder
2007-08-17 23:28     ` msnyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200708051852.l75Iq0Du032483@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@sonic.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox