Ticket #1927: 1927-missing-g_free-in-vfs-extfs.c.patch

File 1927-missing-g_free-in-vfs-extfs.c.patch, 1.8 KB (added by vit_r, 14 years ago)

four missing g_free(q) in vfs/extfs.c

  • vfs/extfs.c

    From cd91f47a9f7166c00d8a05677324649b8bd2eda2 Mon Sep 17 00:00:00 2001
    From: Vit Rosin <vit_r@list.ru>
    Date: Thu, 31 Dec 2009 13:45:57 +0000
    Subject: [PATCH]  in vfs-extfs.c funcs extfs_readlink(), extfs_unlink(), extfs_mkdir() and extfs_rmdir()
      have 'char *q;' which shouid be freed after use
    
    ---
     vfs/extfs.c |    4 ++++
     1 files changed, 4 insertions(+), 0 deletions(-)
    
    diff --git a/vfs/extfs.c b/vfs/extfs.c
    index d30774e..47498c2 100644
    a b extfs_readlink (struct vfs_class *me, const char *path, char *buf, size_t size) 
    10101010    if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL) 
    10111011        goto cleanup; 
    10121012    entry = extfs_find_entry (archive->root_entry, q, 0, 0); 
     1013    g_free (q); 
    10131014    if (entry == NULL) 
    10141015        goto cleanup; 
    10151016    if (!S_ISLNK (entry->inode->mode)) { 
    static int extfs_unlink (struct vfs_class *me, const char *file) 
    10611062    if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL) 
    10621063        goto cleanup; 
    10631064    entry = extfs_find_entry (archive->root_entry, q, 0, 0); 
     1065    g_free (q); 
    10641066    if (entry == NULL) 
    10651067        goto cleanup; 
    10661068    if ((entry = extfs_resolve_symlinks (entry)) == NULL) 
    static int extfs_mkdir (struct vfs_class *me, const char *path, mode_t mode) 
    10971099        goto cleanup; 
    10981100    } 
    10991101    entry = extfs_find_entry (archive->root_entry, q, 1, 0); 
     1102    g_free (q); 
    11001103    if (entry == NULL) 
    11011104        goto cleanup; 
    11021105    if ((entry = extfs_resolve_symlinks (entry)) == NULL) 
    static int extfs_rmdir (struct vfs_class *me, const char *path) 
    11271130    if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL) 
    11281131        goto cleanup; 
    11291132    entry = extfs_find_entry (archive->root_entry, q, 0, 0); 
     1133    g_free (q); 
    11301134    if (entry == NULL) 
    11311135        goto cleanup; 
    11321136    if ((entry = extfs_resolve_symlinks (entry)) == NULL)