소스 검색

* Fixed a few unimportant memory leaks upon error.

pull/1/head
Sam Hocevar sam 18 년 전
부모
커밋
8390d626f9
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. +3
    -1
      src/figlet.c

+ 3
- 1
src/figlet.c 파일 보기

@@ -161,6 +161,7 @@ static struct figfont *open_font(void)
if(!ret)
{
free(data);
free(font->lookup);
free(font);
fprintf(stderr, "read error at glyph %u in `%s'\n",
font->glyphs, path);
@@ -192,6 +193,7 @@ static struct figfont *open_font(void)
if(font->glyphs < EXT_GLYPHS)
{
free(data);
free(font->lookup);
free(font);
fprintf(stderr, "only %u glyphs in `%s', expected at least %u\n",
font->glyphs, path, EXT_GLYPHS);
@@ -206,7 +208,7 @@ static struct figfont *open_font(void)

if(!font->image)
{
cucul_free_canvas(font->image);
free(font->lookup);
free(font);
fprintf(stderr, "libcucul could not load data in `%s'\n", path);
return NULL;


불러오는 중...
취소
저장