Ensure we always free aio_ex on all error paths by moving the TALLOC_FREE call out...
authorJeremy Allison <jra@samba.org>
Thu, 26 Jan 2012 00:27:54 +0000 (16:27 -0800)
committerKarolin Seeger <kseeger@samba.org>
Sun, 12 Feb 2012 20:03:27 +0000 (21:03 +0100)
source3/modules/vfs_aio_fork.c
source3/smbd/aio.c

index 41b5a89dd29c21a23530411d84eb72554ea50fc3..7f6a02157d82c58dd6555f168ab01bee59572b6d 100644 (file)
@@ -434,6 +434,7 @@ static void handle_aio_completion(struct event_context *event_ctx,
 
        aio_ex = (struct aio_extra *)child->aiocb->aio_sigevent.sigev_value.sival_ptr;
        smbd_aio_complete_aio_ex(aio_ex);
+       TALLOC_FREE(aio_ex);
 }
 
 static int aio_child_destructor(struct aio_child *child)
index e9d49cebf7883208cf32d20c504bf675540f2271..b0b90c0dfe54575eeead7ac51d81e831a5b4e7c6 100644 (file)
@@ -66,6 +66,7 @@ static void smbd_aio_signal_handler(struct tevent_context *ev_ctx,
                                info->si_value.sival_ptr;
 
        smbd_aio_complete_aio_ex(aio_ex);
+       TALLOC_FREE(aio_ex);
 }
 
 
@@ -894,8 +895,6 @@ void smbd_aio_complete_aio_ex(struct aio_extra *aio_ex)
        if (!handle_aio_completed(aio_ex, &ret)) {
                return;
        }
-
-       TALLOC_FREE(aio_ex);
 }
 
 /****************************************************************************