Changeset 4847


Ignore:
Timestamp:
Nov 18, 2012, 6:54:27 PM (7 years ago)
Author:
Sam Hocevar
Message:

misc: fix a few memory leaks and invalid memory accesses.

Location:
libcaca/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/file.c

    r4369 r4847  
    11/*
    22 *  libcaca       Colour ASCII-Art library
    3  *  Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net>
     3 *  Copyright (c) 2006-2012 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    119119        if(inflateInit2(&fp->stream, -MAX_WBITS))
    120120        {
     121            gzclose(fp->gz);
    121122            free(fp);
    122             gzclose(fp->gz);
    123123            seterrno(EINVAL);
    124124            return NULL;
  • libcaca/trunk/src/cacaplay.c

    r4369 r4847  
    11/*
    22 *  cacaplay      caca file player
    3  *  Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net>
     3 *  Copyright (c) 2006-2012 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    7979            {
    8080                fprintf(stderr, "%s: read error\n", argv[0]);
     81                free(buf);
    8182                return -1;
    8283            }
     
    111112
    112113    /* Clean up */
     114    free(buf);
    113115    close(fd);
    114116
  • libcaca/trunk/tools/makefont.c

    r4644 r4847  
    11/*
    22 *  makefont      create libcaca font data
    3  *  Copyright (c) 2006-2010 Sam Hocevar <sam@hocevar.net>
     3 *  Copyright (c) 2006-2012 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    338338    g_object_unref(l);
    339339    g_object_unref(cx);
     340    g_object_unref(fm);
    340341
    341342    return 0;
Note: See TracChangeset for help on using the changeset viewer.