diff options
| author | Adam Baratz <adambaratz@php.net> | 2016-09-13 16:43:30 -0400 |
|---|---|---|
| committer | Adam Baratz <adambaratz@php.net> | 2016-09-13 16:43:30 -0400 |
| commit | 69eef8c361c930d406254db16d0479fa74075e92 (patch) | |
| tree | ec0dbc5dead1509496f1582c3561b72bd2496d91 /ext/pdo_dblib/pdo_dblib.c | |
| parent | efadcb0390c3ef1ad0b3c445f886dc697bae44a7 (diff) | |
| download | php-git-69eef8c361c930d406254db16d0479fa74075e92.tar.gz | |
Free error and message strings when cleaning up PDO instances that use pdo_dblib
Diffstat (limited to 'ext/pdo_dblib/pdo_dblib.c')
| -rw-r--r-- | ext/pdo_dblib/pdo_dblib.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index b855224c68..9d119331ce 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -152,6 +152,26 @@ int pdo_dblib_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, return 0; } +void pdo_dblib_err_dtor(pdo_dblib_err *err) +{ + if (!err) { + return; + } + + if (err->dberrstr) { + efree(err->dberrstr); + err->dberrstr = NULL; + } + if (err->lastmsg) { + efree(err->lastmsg); + err->lastmsg = NULL; + } + if (err->oserrstr) { + efree(err->oserrstr); + err->oserrstr = NULL; + } +} + static PHP_GINIT_FUNCTION(dblib) { memset(dblib_globals, 0, sizeof(*dblib_globals)); |
