Freeing w->ctx before options can lead to segfault.
nirbhay@nirbhay-VirtualBox:~/project/repo/codership/5.5$ bzr diff === modified file 'wsrep/wsrep_dummy.c' --- wsrep/wsrep_dummy.c 2014-05-04 07:12:59 +0000 +++ wsrep/wsrep_dummy.c 2014-06-11 20:44:29 +0000 @@ -44,11 +44,11 @@ static void dummy_free(wsrep_t *w) { WSREP_DBUG_ENTER(w); + if (WSREP_DUMMY(w)->options) { + free(WSREP_DUMMY(w)->options); + WSREP_DUMMY(w)->options = NULL; + } free(w->ctx); - if (WSREP_DUMMY(w)->options) { - free(WSREP_DUMMY(w)->options); - WSREP_DUMMY(w)->options = NULL; - } w->ctx = NULL; }
Freeing w->ctx before options can lead to segfault.
nirbhay@ nirbhay- VirtualBox: ~/project/ repo/codership/ 5.5$ bzr diff wsrep_dummy. c' DBUG_ENTER( w); DUMMY(w) ->options) { DUMMY(w) ->options) ; w)->options = NULL; DUMMY(w) ->options) { DUMMY(w) ->options) ; w)->options = NULL;
=== modified file 'wsrep/
--- wsrep/wsrep_dummy.c 2014-05-04 07:12:59 +0000
+++ wsrep/wsrep_dummy.c 2014-06-11 20:44:29 +0000
@@ -44,11 +44,11 @@
static void dummy_free(wsrep_t *w)
{
WSREP_
+ if (WSREP_
+ free(WSREP_
+ WSREP_DUMMY(
+ }
free(w->ctx);
- if (WSREP_
- free(WSREP_
- WSREP_DUMMY(
- }
w->ctx = NULL;
}