Module: kamailio
Branch: master
Commit: 48de750550dd12016e957d60e0ae57e59944558d
URL:
https://github.com/kamailio/kamailio/commit/48de750550dd12016e957d60e0ae57e…
Author: Chris Double <chris.double(a)double.co.nz>
Committer: Chris Double <chris.double(a)double.co.nz>
Date: 2015-09-23T23:48:31+12:00
sqlops: Fix memory leak in error condition
- Fix pv_parse_dbr_name to free spv if the key is
unknown.
- Fix typo in error log in pv_parse_dbr_name.
---
Modified: modules/sqlops/sql_var.c
---
Diff:
https://github.com/kamailio/kamailio/commit/48de750550dd12016e957d60e0ae57e…
Patch:
https://github.com/kamailio/kamailio/commit/48de750550dd12016e957d60e0ae57e…
---
diff --git a/modules/sqlops/sql_var.c b/modules/sqlops/sql_var.c
index 940ec5a..20ec672 100644
--- a/modules/sqlops/sql_var.c
+++ b/modules/sqlops/sql_var.c
@@ -257,7 +257,9 @@ int pv_parse_dbr_name(pv_spec_p sp, str *in)
if(p>in->s+in->len || *p=='\0' || *p!=']')
goto error_index;
} else {
- LM_ERR("unknow key [%.*s]\n", pvs.len, pvs.s);
+ LM_ERR("unknown key [%.*s]\n", pvs.len, pvs.s);
+ if(spv!=NULL)
+ pkg_free(spv);
return -1;
}
sp->pvp.pvn.u.dname = (void*)spv;