Fix a valgrind error / segfault in dns_register_smbd()
authorVolker Lendecke <vl@samba.org>
Tue, 10 Mar 2009 13:06:05 +0000 (14:06 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 10 Mar 2009 13:07:19 +0000 (14:07 +0100)
source/smbd/dnsregister.c

index 6850d1a9c4d3715cec274634ff2090ffc6000018..ff9be435a6239e45f168de75624fb46981a4cc78 100644 (file)
@@ -108,7 +108,8 @@ void dns_register_smbd(struct dns_reg_state ** dns_state_ptr,
        struct dns_reg_state *dns_state = *dns_state_ptr;
 
        if (dns_state == NULL) {
        struct dns_reg_state *dns_state = *dns_state_ptr;
 
        if (dns_state == NULL) {
-               *dns_state_ptr = dns_state = talloc(NULL, struct dns_reg_state);
+               dns_state = talloc_zero(NULL, struct dns_reg_state);
+               *dns_state_ptr = dns_state;
                if (dns_state == NULL) {
                        return;
                }
                if (dns_state == NULL) {
                        return;
                }