summaryrefslogtreecommitdiff
path: root/source3/nsswitch/pam_winbind.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-11-15 02:06:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:48 -0500
commit8f723972ae433d7ce707e9f9aab431c19c7aaeaf (patch)
tree2347683929dbc86defba0ef0476b69377324c09f /source3/nsswitch/pam_winbind.c
parent46e59a57eb4d00c4070119dd1584d3158dfb68d1 (diff)
downloadsamba-8f723972ae433d7ce707e9f9aab431c19c7aaeaf.tar.gz
samba-8f723972ae433d7ce707e9f9aab431c19c7aaeaf.tar.bz2
samba-8f723972ae433d7ce707e9f9aab431c19c7aaeaf.zip
r19710: Fix memory leak in get_conf_item_string(). As
we're just doing strchr on a const string there's no need to strdup it before, we're never modifying it. Just remove the variable "parm". Jeremy. (This used to be commit 1af18f613b1399220e38e7ab40665c2ca177c5a7)
Diffstat (limited to 'source3/nsswitch/pam_winbind.c')
-rw-r--r--source3/nsswitch/pam_winbind.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index 1d9053ff3e..a61dceedce 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -901,7 +901,6 @@ const char *get_conf_item_string(const pam_handle_t *pamh,
int config_flag)
{
int i = 0;
- char *parm = NULL;
const char *parm_opt = NULL;
char *key = NULL;
@@ -926,9 +925,7 @@ const char *get_conf_item_string(const pam_handle_t *pamh,
if ((strncmp(argv[i], item, strlen(item)) == 0)) {
char *p;
- parm = strdup(argv[i]);
-
- if ( (p = strchr( parm, '=' )) == NULL) {
+ if ( (p = strchr( argv[i], '=' )) == NULL) {
_pam_log(pamh, ctrl, LOG_INFO, "no \"=\" delimiter for \"%s\" found\n", item);
goto out;
}
@@ -941,7 +938,6 @@ const char *get_conf_item_string(const pam_handle_t *pamh,
_pam_log_debug(pamh, ctrl, LOG_INFO, "CONFIG file: %s '%s'\n", item, parm_opt);
}
out:
- SAFE_FREE(parm);
return parm_opt;
}