[SSSD] [PATCH] Use deep copy for dns_domain and discovery_domain

Lukas Slebodnik lslebodn at redhat.com
Mon Jun 3 10:44:19 UTC 2013


ehlo,

srv_data->dns_domain and srv_data->discovery_domain pointed to the same memory.

srv_data->dns_domain was freed in function resolve_srv_done()
but srv_data->discovery_domain was used on another place.

If there is a reason, that dns_domain and discovery_domain should be the same,
then It is possible to unite them to one "domain" member

Patch is attached

LS
-------------- next part --------------
>From 037d9b088eeb6b6f380fa3bc453481d2c60fa9c3 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 31 May 2013 20:22:54 +0200
Subject: [PATCH] Use deep copy for dns_domain and discovery_domain

https://fedorahosted.org/sssd/ticket/1929
---
 src/providers/fail_over.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index 81fc45ce3ca46018dfb9fcccea47bc434a9608d7..12b6c37828b7da0e68579bbb94668c21574974f1 100644
--- a/src/providers/fail_over.c
+++ b/src/providers/fail_over.c
@@ -564,8 +564,10 @@ fo_add_srv_server(struct fo_service *service, const char *srv,
                                                            discovery_domain);
         if (server->srv_data->discovery_domain == NULL)
             return ENOMEM;
-        server->srv_data->dns_domain =
-                server->srv_data->discovery_domain;
+        server->srv_data->dns_domain = talloc_strdup(server->srv_data,
+                                                     discovery_domain);
+        if (server->srv_data->dns_domain == NULL)
+            return ENOMEM;
     }
 
     server->srv_data->sssd_domain =
-- 
1.8.1.4



More information about the sssd-devel mailing list