s3: torture - Add required talloc frame for msgtest.c
authorJeremy Allison <jra@samba.org>
Tue, 22 Apr 2014 22:55:53 +0000 (15:55 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 23 Apr 2014 20:33:09 +0000 (22:33 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
source3/torture/msgtest.c

index ed28667b8d96f68df86bef1d0505ee30c66a1996..32f4b04cf0c096da76490cba7c11d65def9b9d00 100644 (file)
@@ -46,6 +46,7 @@ static void pong_message(struct messaging_context *msg_ctx,
        int i, n;
        char buf[12];
        int ret;
+       TALLOC_CTX *frame = talloc_stackframe();
 
        load_case_tables();
 
@@ -56,12 +57,14 @@ static void pong_message(struct messaging_context *msg_ctx,
        if (!(evt_ctx = samba_tevent_context_init(NULL)) ||
            !(msg_ctx = messaging_init(NULL, evt_ctx))) {
                fprintf(stderr, "could not init messaging context\n");
+               TALLOC_FREE(frame);
                exit(1);
        }
 
        if (argc != 3) {
                fprintf(stderr, "%s: Usage - %s pid count\n", argv[0],
                        argv[0]);
+               TALLOC_FREE(frame);
                exit(1);
        }
 
@@ -152,6 +155,7 @@ static void pong_message(struct messaging_context *msg_ctx,
                       (ping_count+pong_count)/timeval_elapsed(&tv));
        }
 
+       TALLOC_FREE(frame);
        return (0);
 }