diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2011-08-24 20:22:20 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2011-08-24 20:22:20 +0000 |
commit | d7dc1c48746ce2b8ff8c35c46c4431bda3b222c2 (patch) | |
tree | d723cc81205e04184c0108f0706575e63ed786a2 | |
parent | 61dea587df742c526573cf2913fa8b471c5bb80b (diff) |
fix a problem with uninitialised memory while parsing the tls_ciphers option (was broken in r853, similar problem was fixed in r910, reported by Isaac Freeman)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1515 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nslcd/cfg.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/nslcd/cfg.c b/nslcd/cfg.c index ac354c0..b0cca51 100644 --- a/nslcd/cfg.c +++ b/nslcd/cfg.c @@ -403,12 +403,10 @@ static void get_restdup(const char *filename,int lnr, char **var) { check_argumentcount(filename,lnr,keyword,(*line!=NULL)&&(**line!='\0')); - if ((*var==NULL)||(strcmp(*var,*line)!=0)) - { - /* Note: we have a memory leak here if a single mapping is changed - multiple times in one config (deemed not a problem) */ - *var=xstrdup(*line); - } + /* Note: we have a memory leak here if a single mapping is changed + multiple times in one config (deemed not a problem) */ + *var=xstrdup(*line); + /* mark that we are at the end of the line */ *line=NULL; } @@ -579,7 +577,7 @@ static void set_base(const char *filename,int lnr, static void parse_validnames_statement(const char *filename,int lnr, const char *keyword,char *line,struct ldap_config *cfg) { - char *value=NULL; + char *value; int i,l; int flags=REG_EXTENDED|REG_NOSUB; /* the rest of the line should be a regular expression */ |