s4-libnet Always return after composite_error()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 23 Apr 2012 07:27:02 +0000 (17:27 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 23 Apr 2012 10:48:02 +0000 (20:48 +1000)
This can and does cause crashes as multiple conflicting sets of callbacks run on
memory that may have been destroyed.

Andrew Bartlett

source4/libnet/groupinfo.c
source4/libnet/libnet_domain.c
source4/libnet/userinfo.c

index 932ab0ca9a737c6987e83cb03488e06ca4df719a..0bc0d9f4b8cfca9c020790a3e5d3e68875b08976 100644 (file)
@@ -93,6 +93,7 @@ static void continue_groupinfo_lookup(struct tevent_req *subreq)
           - we're looking for only one at the moment */
        if (s->lookup.out.rids->count == 0) {
                composite_error(c, NT_STATUS_NO_SUCH_USER);
+               return;
        }
 
        /* TODO: find proper status code for more than one rid found */
index d2b96958eea0fa3e9b1871ea9aa431d0f8dd6fcb..acd2ece7a98c6c891e50f4c8dbe46a96e4312d03 100644 (file)
@@ -1137,6 +1137,7 @@ static void continue_samr_close_handle(struct tevent_req *subreq)
        /* did everything go fine ? */
        if (!NT_STATUS_IS_OK(s->samrclose.out.result)) {
                composite_error(c, s->samrclose.out.result);
+               return;
        }
 
        composite_done(c);
index d485eecf5b4856d46d04931b6b1a3d89d3985c50..ddb249ee96c3923ab71d38a464330a31f8c4444f 100644 (file)
@@ -92,6 +92,7 @@ static void continue_userinfo_lookup(struct tevent_req *subreq)
           - we're looking for only one at the moment */
        if (s->lookup.out.rids->count == 0) {
                composite_error(c, NT_STATUS_NO_SUCH_USER);
+               return;
        }
 
        /* TODO: find proper status code for more than one rid found */