Ticket #2032: 2032-possible-mem-leaks-in-src-screen.c.patch

File 2032-possible-mem-leaks-in-src-screen.c.patch, 986 bytes (added by vit_r, 14 years ago)

possible-mem-leaks-in-src-screen.c

  • src/screen.c

    From d83ecb5d7dd11a16f074a83975be3921ba75063d Mon Sep 17 00:00:00 2001
    From: Vit Rosin <vit_r@list.ru>
    Date: Tue, 16 Feb 2010 18:03:17 +0000
    Subject: [PATCH]  possible mem-leaks in src/screen.c
    
    ---
     src/screen.c |   12 ++++++++++++
     1 files changed, 12 insertions(+), 0 deletions(-)
    
    diff --git a/src/screen.c b/src/screen.c
    index 428fe88..3a6764a 100644
    a b remove_encoding_from_path (const char *path) 
    10261026    GIConv converter; 
    10271027 
    10281028    ret = g_string_new(""); 
     1029    if (ret == NULL) 
     1030        return NULL; 
     1031 
    10291032    tmp_conv = g_string_new(""); 
     1033    if (tmp_conv == NULL) { 
     1034        g_string_free (ret,TRUE); 
     1035        return NULL; 
     1036    } 
    10301037 
    10311038    tmp_path = g_string_new(path); 
     1039    if (tmp_path == NULL) { 
     1040        g_string_free (ret,TRUE); 
     1041        g_string_free (tmp_conv,TRUE); 
     1042        return NULL; 
     1043    } 
    10321044 
    10331045    while ((tmp = g_strrstr (tmp_path->str, "/#enc:")) != NULL){ 
    10341046        enc = vfs_get_encoding ((const char *) tmp);