Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [PATCH/RFA] language.c free(0)
@ 2000-04-01  0:00 David Taylor
  2000-03-16 12:00 ` David Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: David Taylor @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: gdb-patches

    Date: Thu, 16 Mar 100 20:26:56 +0100 (CET)
    From: "Philippe De Muyter" <phdm@macqel.be>

    May I inaugurate my ssh connection by applying the following patch ? Here,
    gdb crashes when one attempts to free a null pointer.

Yes.

    Wed Mar 15 07:04:17 2000  Philippe De Muyter  <phdm@macqel.be>

	    * language.c (set_lang_str): Do not call `free' for a null pointer.
	    (set_type_str, set_range_str): Ditto.

Approved.

    --- ./gdb/language.c    Mon Mar 13 20:01:32 2000
    +++ ./gdb/language.c    Sun Feb 20 03:23:37 2000
    @@ -394,7 +394,8 @@ set_lang_str ()
     {
       char *prefix = "";

    -  free (language);
    +  if (language)
    +    free (language);
       if (language_mode == language_mode_auto)
	 prefix = "auto; currently ";

    @@ -406,7 +407,8 @@ set_type_str ()
     {
       char *tmp = NULL, *prefix = "";

    -  free (type);
    +  if (type)
    +    free (type);
       if (type_mode == type_mode_auto)
	 prefix = "auto; currently ";

    @@ -451,7 +453,8 @@ set_range_str ()
	   error ("Unrecognized range check setting.");
	 }

    -  free (range);
    +  if (range)
    +    free (range);
       range = concat (pref, tmp, NULL);
     }


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-01  0:00 [PATCH/RFA] language.c free(0) David Taylor
2000-03-16 12:00 ` David Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox