summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/eventlog/eventlog.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/source3/lib/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c
index 1c0dba980d..dc14214e36 100644
--- a/source3/lib/eventlog/eventlog.c
+++ b/source3/lib/eventlog/eventlog.c
@@ -65,14 +65,28 @@ TDB_CONTEXT *elog_init_tdb( char *tdbfilename )
char *elog_tdbname(TALLOC_CTX *ctx, const char *name )
{
- char *path = talloc_asprintf(ctx, "%s/%s.tdb",
- state_path("eventlog"),
- name);
+ char *path;
+ char *file;
+ char *tdbname;
+
+ path = talloc_strdup(ctx, state_path("eventlog"));
if (!path) {
return NULL;
}
- strlower_m(path);
- return path;
+
+ file = talloc_asprintf_strlower_m(path, "%s.tdb", name);
+ if (!file) {
+ talloc_free(path);
+ return NULL;
+ }
+
+ tdbname = talloc_asprintf(path, "%s/%s", state_path("eventlog"), file);
+ if (!tdbname) {
+ talloc_free(path);
+ return NULL;
+ }
+
+ return tdbname;
}