diff options
author | Niels de Vos <ndevos@redhat.com> | 2016-09-30 12:55:40 +0200 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-10-20 06:13:29 -0700 |
commit | d73ca4a5bfad1e46dfc4a3a12401d8720b05c298 (patch) | |
tree | baae2713f558b40beb8cc4c5ee5f1e9010af5d3a /tests | |
parent | daea58a51b70f80ab04f115e49f8bf8790b6046a (diff) |
tests: gfapi/bug1291259.c should only call glfs_free() on success
In case glfs_h_poll_upcall() does not return success, the 'struct
glfs_upcall' would not have been allocated. A retry will be done and
glfs_free() is called on the unallocated structure. In case the pointer
does not point to NULL, glfs_free() will try to free up some random
area.
Change-Id: I38788d3bf22bbac3924f25edf45cd4a2637fa777
BUG: 1371540
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/15603
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/gfapi/bug1291259.c | 6 | ||||
-rwxr-xr-x | tests/basic/gfapi/bug1291259.t | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/basic/gfapi/bug1291259.c b/tests/basic/gfapi/bug1291259.c index 78b95c6dcfd..26fc1e01449 100644 --- a/tests/basic/gfapi/bug1291259.c +++ b/tests/basic/gfapi/bug1291259.c @@ -161,8 +161,10 @@ retry: if (!upcall_received) sleep (1); /* glfs_h_poll_upcall() does not block */ - glfs_free (cbk); - cbk = NULL; + if (!ret) { + glfs_free (cbk); + cbk = NULL; + } } if (!upcall_received) { diff --git a/tests/basic/gfapi/bug1291259.t b/tests/basic/gfapi/bug1291259.t index 570ac00a3a6..2247c567ffc 100755 --- a/tests/basic/gfapi/bug1291259.t +++ b/tests/basic/gfapi/bug1291259.t @@ -28,5 +28,3 @@ TEST $CLI volume stop $V0 TEST $CLI volume delete $V0 cleanup; -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=1371540 -#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=1371540 |