From 936f41ec0ce1736e74b2fda2c65249956498c777 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 12 Dec 2020 17:20:40 +0000 Subject: Smart pointer stmt to fix leak --- libmysqlpp/my-modifycommand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libmysqlpp/my-modifycommand.cpp') diff --git a/libmysqlpp/my-modifycommand.cpp b/libmysqlpp/my-modifycommand.cpp index 7610a27..dd607b3 100644 --- a/libmysqlpp/my-modifycommand.cpp +++ b/libmysqlpp/my-modifycommand.cpp @@ -12,10 +12,10 @@ unsigned int MySQL::ModifyCommand::execute(bool anc) { bindParams(); - if (mysql_stmt_execute(stmt)) { - throw Error(stmt); + if (mysql_stmt_execute(stmt.get())) { + throw Error(stmt.get()); } - int rows = mysql_stmt_affected_rows(stmt); + int rows = mysql_stmt_affected_rows(stmt.get()); if (rows == 0 && !anc) { throw DB::NoRowsAffected(); } -- cgit v1.2.3