oops.. free pointers that might be null.. checdk for that first!

SVN revision: 5140
This commit is contained in:
Carsten Haitzler 2001-08-13 13:38:19 +00:00
parent d1227e7040
commit 70d6cef5b3
1 changed files with 6 additions and 6 deletions

View File

@ -2007,8 +2007,8 @@ imlib_load_font(const char *font_name)
if (!ttfname || !xfontsetname ) if (!ttfname || !xfontsetname )
{ {
free(ttfname); if (ttfname) free(ttfname);
free(xfontsetname); if (xfontsetname) free(xfontsetname);
return NULL; return NULL;
} }
@ -2058,8 +2058,8 @@ imlib_load_font(const char *font_name)
if (fn->type == IMLIB_FONT_TYPE_TTF_X) if (fn->type == IMLIB_FONT_TYPE_TTF_X)
fn->xf.ttffont->hdr.references++; fn->xf.ttffont->hdr.references++;
free(ttfname); if (ttfname) free(ttfname);
free(xfontsetname); if (xfontsetname) free(xfontsetname);
return fn; return fn;
} }
@ -2079,8 +2079,8 @@ imlib_load_font(const char *font_name)
/* error */ /* error */
if (!xf) if (!xf)
{ {
free(ttfname); if (ttfname) free(ttfname);
free(xfontsetname); if (xfontsetname) free(xfontsetname);
return NULL; return NULL;
} }
} }