summaryrefslogtreecommitdiffstats
path: root/source3/nsswitch/idmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/idmap.c')
-rw-r--r--source3/nsswitch/idmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/nsswitch/idmap.c b/source3/nsswitch/idmap.c
index 4652980807d..6de2187e5f0 100644
--- a/source3/nsswitch/idmap.c
+++ b/source3/nsswitch/idmap.c
@@ -1283,8 +1283,8 @@ void idmap_dump_maps(char *logfile)
fclose(dump);
}
-const char *idmap_fecth_secret(const char *backend, bool alloc,
- const char *domain, const char *identity)
+char *idmap_fetch_secret(const char *backend, bool alloc,
+ const char *domain, const char *identity)
{
char *tmp, *ret;
int r;
@@ -1295,11 +1295,13 @@ const char *idmap_fecth_secret(const char *backend, bool alloc,
r = asprintf(&tmp, "IDMAP_%s_%s", backend, domain);
}
- if (r < 0) return NULL;
+ if (r < 0)
+ return NULL;
strupper_m(tmp); /* make sure the key is case insensitive */
ret = secrets_fetch_generic(tmp, identity);
- free(tmp);
+ SAFE_FREE( tmp );
+
return ret;
}