s3 OneFS: Fix a double free in an error path
authorTim Prouty <tprouty@samba.org>
Tue, 24 Feb 2009 01:43:47 +0000 (17:43 -0800)
committerTim Prouty <tprouty@samba.org>
Tue, 24 Feb 2009 07:22:03 +0000 (23:22 -0800)
source3/smbd/oplock_onefs.c

index 0908ce4386dae8343a48b5296603f2b50fb834a6..d4f181fc472f410217630f6fc1ea34ff669e396b 100644 (file)
@@ -744,13 +744,13 @@ struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
        po.po_flags_on |= P_NON_BLOCKING_SEMLOCK;
        if (setprocoptions(&po) != 0) {
                DEBUG(0, ("setprocoptions failed: %s.\n", strerror(errno)));
-               goto err_out;
+               return NULL;
        }
 
        /* Setup the oplock contexts */
        _ctx = talloc_zero(mem_ctx, struct kernel_oplocks);
        if (!_ctx) {
-               goto err_out;
+               return NULL;
        }
 
        ctx = talloc_zero(_ctx, struct onefs_oplocks_context);
@@ -788,7 +788,6 @@ struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx)
 
  err_out:
        talloc_free(_ctx);
-       talloc_free(ctx);
        return NULL;
 }