Make this not crash when compiled with -g.

Found by myself, analysis by kurt@, fix by me with input from otto.

``Just get some fix in...'' deraadt
This commit is contained in:
mk 2008-06-16 19:09:48 +00:00
parent 07cd0b1ac5
commit 867652c484
2 changed files with 3 additions and 6 deletions

2
conf.c
View File

@ -171,7 +171,7 @@ conf_init(struct conf *c)
strlcpy(c->termpath, "xterm", sizeof(c->termpath)); strlcpy(c->termpath, "xterm", sizeof(c->termpath));
strlcpy(c->lockpath, "xlock", sizeof(c->lockpath)); strlcpy(c->lockpath, "xlock", sizeof(c->lockpath));
c->DefaultFontName = DEFAULTFONTNAME; c->DefaultFontName = xstrdup(DEFAULTFONTNAME);
} }
void void

View File

@ -100,11 +100,8 @@ yesno : YES { $$ = 1; }
; ;
main : FONTNAME STRING { main : FONTNAME STRING {
if (conf->DefaultFontName != NULL &&
conf->DefaultFontName != DEFAULTFONTNAME)
free(conf->DefaultFontName); free(conf->DefaultFontName);
conf->DefaultFontName = xstrdup($2); conf->DefaultFontName = $2;
free($2);
} }
| STICKY yesno { | STICKY yesno {
if ($2 == 0) if ($2 == 0)