Skip to content

Commit d8068c8

Browse files
committed
reverting to curl leak fix to make sync [skip ci]
1 parent 2ac7030 commit d8068c8

File tree

2 files changed

+9
-62
lines changed

2 files changed

+9
-62
lines changed

informix_auditing/audit_util.c

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,13 @@ mi_string *do_castl(MI_CONNECTION *conn, MI_DATUM *datum,
6868
printf("-- typeName=%s --",srcType);
6969
if ((strcmp("blob", srcType) == 0) || (strcmp("clob", srcType) == 0) || (strcmp("text", srcType) == 0) || (strcmp("byte", srcType) == 0)) {
7070
printf("skiping data read\n");
71-
mi_free(dsc);
72-
mi_free(srcType);
7371
return("unsupportedtype");
7472
}
7573
else{
7674
if (strcmp("date", srcType) == 0) {
77-
mi_free(dsc);
78-
mi_free(srcType);
7975
return (mi_date_to_string((mi_date *)datum));
8076
}
8177
if (strcmp("datetime", srcType) == 0) {
82-
mi_free(dsc);
83-
mi_free(srcType);
8478
return (mi_datetime_to_string((mi_datetime *)datum));
8579
}
8680
if ((strcmp("integer", srcType) == 0) ||
@@ -128,11 +122,7 @@ mi_string *do_castl(MI_CONNECTION *conn, MI_DATUM *datum,
128122
mi_routine_end(conn, fn);
129123
//return mi_type_typename(mi_type_typedesc(conn, my_type_id));
130124
}
131-
mi_free(fp);
132-
mi_free(dsc);
133-
mi_free(srcType);
134-
mi_free(typeid);
135-
mi_free(tdesc);
125+
136126
return(pbuf);
137127
}
138128
/*--------------------------------------------------------------*/
@@ -216,15 +206,6 @@ mi_string *doInsertCN()
216206
}
217207
printf("\"DBNAME-TABLENAME-operation-TIME\": \"%s-%s-INSERT-%s-Completed\" \n",pdbname,tabname,cdatetime);
218208
free(cdatetime);
219-
mi_free(row);
220-
mi_free(tid);
221-
mi_free(lvarTid);
222-
mi_free(td);
223-
mi_free(rd);
224-
mi_free(ptabname);
225-
mi_free(pcolname);
226-
mi_free(pcast);
227-
mi_free(pdbname);
228209
return(buffer);
229210
}
230211
/*--------------------------------------------------------------*/
@@ -270,7 +251,7 @@ mi_string *doSelectCN()
270251
for (i = 0; i < colCount; i++) {
271252
/* get column name and type id */
272253
pcolname = mi_column_name(rd, i);
273-
DPRINTF("logger", 90, ("insert: colname: (0x%x) [%s]", pcolname, pcolname));
254+
DPRINTF("logger", 90, ("insert: colname: (0x%x) [%s]", pcolname, pcolname));
274255
tid = mi_column_type_id(rd, i);
275256
switch(mi_value(row, i, &datum, &collen)) {
276257
/* we should do this test */
@@ -343,7 +324,7 @@ mi_string *doDeleteCN()
343324
for (i = 0; i < colCount; i++) {
344325
/* get column name and type id */
345326
pcolname = mi_column_name(rd, i);
346-
DPRINTF("logger", 90, ("delete: colname: (0x%x) [%s]", pcolname, pcolname));
327+
DPRINTF("logger", 90, ("delete: colname: (0x%x) [%s]", pcolname, pcolname));
347328
tid = mi_column_type_id(rd, i);
348329
switch(mi_value(row, i, &datum, &collen)) {
349330
/* we should do this test */
@@ -383,16 +364,7 @@ mi_string *doDeleteCN()
383364
sprintf(&buffer[posi], "}, \n \"uniquedatatype\" : \"false\" \n }");
384365
}
385366
printf("\"DBNAME-TABLENAME-operation-TIME\": \"%s-%s-DELETE-%s-Completed\" \n ", pdbname,ptabname,cdatetime);
386-
free(cdatetime);
387-
mi_free(row);
388-
mi_free(tid);
389-
mi_free(lvarTid);
390-
mi_free(td);
391-
mi_free(rd);
392-
mi_free(ptabname);
393-
mi_free(pcolname);
394-
mi_free(pcast);
395-
mi_free(pdbname);
367+
free(cdatetime);
396368
return(buffer);
397369
}
398370
/*--------------------------------------------------------------*/
@@ -509,19 +481,6 @@ mi_string *doUpdateCN()
509481
DPRINTF("logger", 90, ("Exiting doUpdateCN()"));
510482
printf("\"DBNAME-TABLENAME-operation-TIME\": \"%s-%s-UPDATE-%s-Completed\" \n ", pdbname,ptabname,cdatetime);
511483
free(cdatetime);
512-
mi_free(oldRow);
513-
mi_free(newRow);
514-
mi_free(tid);
515-
mi_free(lvarTid);
516-
mi_free(td);
517-
mi_free(rdOld);
518-
mi_free(rdNew);
519-
mi_free(ptabname);
520-
mi_free(poldcolname);
521-
mi_free(pnewcolname);
522-
mi_free(pcast);
523-
mi_free(pcast2);
524-
mi_free(pdbname);
525484
return(buffer);
526485
}
527486
/*--------------------------------------------------------------*/

informix_auditing/auditing2.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ void do_auditing2( mi_lvarchar *sessionusername, MI_FPARAM *fp)
6464
if (strcmp(mi_lvarchar_to_string(sessionusername), "ifxsyncuser") == 0)
6565
{
6666
printf("automated user. skipping trigger\n");
67-
mi_free(sessionusername);
6867
return;
6968
}
7069
DPRINTF("logger", 80, ("Entering do_auditing2()"));
@@ -137,21 +136,11 @@ void do_auditing2( mi_lvarchar *sessionusername, MI_FPARAM *fp)
137136
if (pmem->gothandle == 0) {
138137
cbhandle = mi_register_callback(NULL, MI_EVENT_END_XACT, cbfunc,
139138
(void *)pmem, NULL);
140-
if (cbhandle == NULL) {
139+
if (cbhandle == NULL)
141140
mi_db_error_raise(NULL, MI_EXCEPTION,
142141
"Callback registration failed", NULL);
143-
}
144-
else
145-
{
146-
mi_free(cbhandle);
147-
}
148142
pmem->gothandle = 1;
149143
}
150-
mi_free(pmem);
151-
mi_free(pdata);
152-
mi_free(sessionConnection);
153-
mi_free(curChain);
154-
mi_free(sessionusername);
155144
DPRINTF("logger", 80, ("Exiting do_auditing2()"));
156145
return;
157146
}
@@ -189,7 +178,7 @@ MI_CALLBACK_STATUS MI_PROC_CALLBACK
189178
}
190179
/* write the record out */
191180
if (pcur == NULL) {
192-
DPRINTF("logger", 80, ("cbfunc(): pcur is null"));
181+
DPRINTF("logger", 80, ("cbfunc(): pcur is null"));
193182
} else {
194183
char filetime_buffer[30];
195184
struct timeval file_tv;
@@ -199,11 +188,11 @@ MI_CALLBACK_STATUS MI_PROC_CALLBACK
199188
strftime(filetime_buffer,30,"%m-%d-%Y_%T.",localtime(&file_curtime));
200189
printf("%s%ld\n",filetime_buffer,file_tv.tv_usec);
201190
sprintf(buffer, "%s%d_%d_%s%ld.json", LOGGERFILEPREFIX,
202-
pmem->sessionId, pcur->seq,filetime_buffer,file_tv.tv_usec);
203-
DPRINTF("logger", 80, ("cbfunc(): about to open file %s", buffer));
191+
pmem->sessionId, pcur->seq,filetime_buffer,file_tv.tv_usec);
192+
DPRINTF("logger", 80, ("cbfunc(): about to open file %s", buffer));
204193
fd = mi_file_open(buffer, O_WRONLY | O_APPEND | O_CREAT, 0644);
205194
if (pcur->json == NULL) {
206-
DPRINTF("logger", 80, ("cbfunc(): pcur->json is null"));
195+
DPRINTF("logger", 80, ("cbfunc(): pcur->json is null"));
207196
} else {
208197
ret = mi_file_write(fd, pcur->json, strlen(pcur->json));
209198
int res=posttopic(pcur->json, "http://ifxpg-migrator.topcoder-dev.com/fileevents");
@@ -247,7 +236,6 @@ MI_CALLBACK_STATUS MI_PROC_CALLBACK
247236
DPRINTF("logger", 80, (buffer));
248237
}
249238
pmem->gothandle = 0;
250-
mi_free(pmem);
251239
DPRINTF("logger", 80, ("Exiting cbfunc()"));
252240
return(MI_CB_CONTINUE);
253241
}

0 commit comments

Comments
 (0)