From 3119225929463aecfbb1a7fc953263736955271e Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Wed, 7 Oct 2015 13:47:18 +0200 Subject: sss_override: steal msgs string to objs Since msgs is attached to tmp_ctx then all the strings are freed with tmp_ctx. Now steal the strings to objs. Resolves: https://fedorahosted.org/sssd/ticket/2826 Reviewed-by: Pavel Reichl --- src/tools/sss_override.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tools/sss_override.c b/src/tools/sss_override.c index 16b25b216..cf19e8287 100644 --- a/src/tools/sss_override.c +++ b/src/tools/sss_override.c @@ -1006,6 +1006,12 @@ list_user_overrides(TALLOC_CTX *mem_ctx, objs[i].home = ldb_msg_find_attr_as_string(msgs[i], SYSDB_HOMEDIR, NULL); objs[i].shell = ldb_msg_find_attr_as_string(msgs[i], SYSDB_SHELL, NULL); objs[i].gecos = ldb_msg_find_attr_as_string(msgs[i], SYSDB_GECOS, NULL); + + talloc_steal(objs, objs[i].orig_name); + talloc_steal(objs, objs[i].name); + talloc_steal(objs, objs[i].home); + talloc_steal(objs, objs[i].shell); + talloc_steal(objs, objs[i].gecos); } talloc_steal(mem_ctx, objs); @@ -1061,6 +1067,9 @@ list_group_overrides(TALLOC_CTX *mem_ctx, objs[i].name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); objs[i].gid = ldb_msg_find_attr_as_uint(msgs[i], SYSDB_GIDNUM, 0); + + talloc_steal(objs, objs[i].orig_name); + talloc_steal(objs, objs[i].name); } talloc_steal(mem_ctx, objs); -- cgit