summaryrefslogtreecommitdiff
path: root/libmysqlpp/my-command.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-12 17:20:40 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-12 17:20:40 +0000
commit936f41ec0ce1736e74b2fda2c65249956498c777 (patch)
tree0ef446d3d43521417c3bfb57804256fc5d6c22ab /libmysqlpp/my-command.h
parentModern jam lto (diff)
downloadlibdbpp-mysql-936f41ec0ce1736e74b2fda2c65249956498c777.tar.bz2
libdbpp-mysql-936f41ec0ce1736e74b2fda2c65249956498c777.tar.xz
libdbpp-mysql-936f41ec0ce1736e74b2fda2c65249956498c777.zip
Smart pointer stmt to fix leak
Diffstat (limited to 'libmysqlpp/my-command.h')
-rw-r--r--libmysqlpp/my-command.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmysqlpp/my-command.h b/libmysqlpp/my-command.h
index 9b6d72a..4a6426b 100644
--- a/libmysqlpp/my-command.h
+++ b/libmysqlpp/my-command.h
@@ -37,7 +37,7 @@ namespace MySQL {
void * realloc(void * buffer, size_t size);
const Connection * c;
- MYSQL_STMT * stmt;
+ std::unique_ptr<MYSQL_STMT, decltype(&mysql_stmt_close)> stmt;
typedef std::vector<MYSQL_BIND> Binds;
Binds binds;
bool paramsNeedBinding;