gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_28-16


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_28-165-gf29ea3d
Date: Mon, 28 Dec 2009 17:52:57 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  f29ea3dcf3b481ddb06c116d225c410c8de68607 (commit)
      from  205936b91e951651bb1588bc8c30b919702a91f2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=f29ea3dcf3b481ddb06c116d225c410c8de68607


commit f29ea3dcf3b481ddb06c116d225c410c8de68607
Author: Daniele Forsi <address@hidden>
Date:   Mon Dec 28 18:51:02 2009 +0100

    Fix memleak when parsing configuration directories
    
    Output from valgrind:
    ==9376== 9 bytes in 1 blocks are definitely lost in loss record 1 of 1
    ==9376==    at 0x4023C1C: malloc (vg_replace_malloc.c:195)
    ==9376==    by 0x8063AE3: get_locations (cfgreader.c:993)
    ==9376==    by 0x80644F5: gn_cfg_read_default (cfgreader.c:1043)
    ==9376==    by 0x8060544: gn_lib_phoneprofile_load_from_file 
(libfunctions.c:97)
    ==9376==    by 0x804B212: businit (gnokii.c:351)
    ==9376==    by 0x804C3EB: parse_options (gnokii.c:833)
    ==9376==    by 0x804BA02: parse_options (gnokii.c:820)
    ==9376==    by 0x804C48E: main (gnokii.c:1187)

diff --git a/common/cfgreader.c b/common/cfgreader.c
index 712c15b..17b3144 100644
--- a/common/cfgreader.c
+++ b/common/cfgreader.c
@@ -966,7 +966,7 @@ static char **get_locations(int *retval)
        char **config_file_locations;
        char *xdg_config_home, *xdg_config_dirs, *home; /* env variables */
        char **xdg_config_dir;
-       char *aux;
+       char *aux, *dirs;
        int j, i = 0;
        char path[MAX_PATH_LEN];
        int size = 8; /* default size for config_file_locations */
@@ -992,6 +992,7 @@ static char **get_locations(int *retval)
        else
                xdg_config_dirs = strdup(XDG_CONFIG_DIRS);
 
+       dirs = xdg_config_dirs;
        /* split out xdg_config_dirs into tokens separated by ':' */
        xdg_config_dir = calloc(xcd_size, sizeof(char *));
        while ((aux = strsep(&xdg_config_dirs, ":")) != NULL) {
@@ -1001,7 +1002,7 @@ static char **get_locations(int *retval)
                        xdg_config_dir = realloc(xdg_config_dir, xcd_size);
                }
        }
-       free(xdg_config_dirs);
+       free(dirs);
 
        /* 1. $XDG_CONFIG_HOME/gnokii/config ($HOME/.config) */
        snprintf(path, MAX_PATH_LEN, "%s/gnokii/config", xdg_config_home);

-----------------------------------------------------------------------

Summary of changes:
 common/cfgreader.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs




reply via email to

[Prev in Thread] Current Thread [Next in Thread]