From 70a7a5f2f62706db1b020eaebc77f07fa115a16f Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 27 Aug 2015 09:16:00 +0300 Subject: [PATCH] Fix to MXS-328: https://mariadb.atlassian.net/browse/MXS-328 Removed gwbuf_free when the write fails. --- server/modules/routing/readwritesplit/readwritesplit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index ca13420a2..b8ad34719 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -2586,8 +2586,8 @@ static bool route_single_stmt( rses_end_locked_router_action(rses); goto retblock; } - GWBUF* wbuf = gwbuf_clone(querybuf); - if ((ret = target_dcb->func.write(target_dcb, wbuf)) == 1) + + if ((ret = target_dcb->func.write(target_dcb, gwbuf_clone(querybuf))) == 1) { backend_ref_t* bref; @@ -2601,7 +2601,6 @@ static bool route_single_stmt( } else { - gwbuf_free(wbuf); LOGIF((LE|LT), (skygw_log_write_flush( LOGFILE_ERROR, "Error : Routing query failed.")));