aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
authorPhilippe De Muyter <phdm@macqel.be>2000-03-17 10:19:22 +0000
committerPhilippe De Muyter <phdm@macqel.be>2000-03-17 10:19:22 +0000
commitccdaf797f78b0ddf1f63fea1baef497066d1344f (patch)
treef8a33b1ca33e9bfe9f1834c957a39c8dcaa9f2de /gdb/language.c
parentd5afc56eb1c6a3cc0b3e899664bb59689ba12417 (diff)
downloadgdb-ccdaf797f78b0ddf1f63fea1baef497066d1344f.zip
gdb-ccdaf797f78b0ddf1f63fea1baef497066d1344f.tar.gz
gdb-ccdaf797f78b0ddf1f63fea1baef497066d1344f.tar.bz2
* language.c (set_lang_str): Do not call `free' for a null pointer.
(set_type_str, set_range_str): Ditto.
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/language.c b/gdb/language.c
index 7370276..20d2adb 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -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);
}