Skip to content

Commit cd914ba

Browse files
committed
memory leak
1 parent 1d2344e commit cd914ba

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

informix_auditing/auditing2.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,18 @@ void do_auditing2( mi_lvarchar *sessionusername, MI_FPARAM *fp)
136136
if (pmem->gothandle == 0) {
137137
cbhandle = mi_register_callback(NULL, MI_EVENT_END_XACT, cbfunc,
138138
(void *)pmem, NULL);
139-
if (cbhandle == NULL)
139+
if (cbhandle == NULL) {
140140
mi_db_error_raise(NULL, MI_EXCEPTION,
141141
"Callback registration failed", NULL);
142+
}
143+
else
144+
{
145+
mi_free(cbhandle);
146+
}
142147
pmem->gothandle = 1;
143148
}
149+
mi_free(pmem);
150+
mi_free(pdata);
144151
DPRINTF("logger", 80, ("Exiting do_auditing2()"));
145152
return;
146153
}

0 commit comments

Comments
 (0)