Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42ccbe4

Browse files
author
Michael Meskes
committed
Free memory in ecpg bytea regression test.
While not really a problem it's easier to run tools like valgrind against itwhen fixed.
1 parent0cc0507 commit42ccbe4

File tree

3 files changed

+59
-57
lines changed

3 files changed

+59
-57
lines changed

‎src/interfaces/ecpg/test/expected/sql-bytea.c

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -200,116 +200,117 @@ if (sqlca.sqlcode < 0) sqlprint();}
200200

201201
dump_binary(recv_vlen_buf[0].arr,recv_vlen_buf[0].len,0);
202202
dump_binary(recv_vlen_buf[1].arr,recv_vlen_buf[1].len,0);
203+
free(recv_vlen_buf);
203204

204205
/* Test for dynamic sql statement with normal host variable, indicator */
205206
init();
206207
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"truncate test",ECPGt_EOIT,ECPGt_EORT);
207-
#line86 "bytea.pgc"
208+
#line87 "bytea.pgc"
208209

209210
if (sqlca.sqlcode<0)sqlprint();}
210-
#line86 "bytea.pgc"
211+
#line87 "bytea.pgc"
211212

212213
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_execute,"ins_stmt",
213214
ECPGt_bytea,&(send_buf[0]),(long)DATA_SIZE,(long)1,sizeof(structbytea_1),
214215
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
215216
ECPGt_bytea,&(send_buf[1]),(long)DATA_SIZE,(long)1,sizeof(structbytea_1),
216217
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
217-
#line87 "bytea.pgc"
218+
#line88 "bytea.pgc"
218219

219220
if (sqlca.sqlcode<0)sqlprint();}
220-
#line87 "bytea.pgc"
221+
#line88 "bytea.pgc"
221222

222223
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_execute,"sel_stmt",ECPGt_EOIT,
223224
ECPGt_bytea,&(recv_buf[0]),(long)DATA_SIZE,(long)1,sizeof(structbytea_2),
224225
ECPGt_int,&(ind[0]),(long)1,(long)1,sizeof(int),
225226
ECPGt_bytea,&(recv_short_buf),(long)DATA_SIZE-LACK_SIZE,(long)1,sizeof(structbytea_4),
226227
ECPGt_int,&(ind[1]),(long)1,(long)1,sizeof(int),ECPGt_EORT);
227-
#line88 "bytea.pgc"
228+
#line89 "bytea.pgc"
228229

229230
if (sqlca.sqlcode<0)sqlprint();}
230-
#line88 "bytea.pgc"
231+
#line89 "bytea.pgc"
231232

232233
dump_binary(recv_buf[0].arr,recv_buf[0].len,ind[0]);
233234
dump_binary(recv_short_buf.arr,recv_short_buf.len,ind[1]);
234235

235236
/* Test for dynamic sql statement with sql descriptor */
236237
init();
237238
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"truncate test",ECPGt_EOIT,ECPGt_EORT);
238-
#line94 "bytea.pgc"
239+
#line95 "bytea.pgc"
239240

240241
if (sqlca.sqlcode<0)sqlprint();}
241-
#line94 "bytea.pgc"
242+
#line95 "bytea.pgc"
242243

243244
{ECPGset_desc(__LINE__,"idesc",1,ECPGd_data,
244245
ECPGt_bytea,&(send_buf[0]),(long)DATA_SIZE,(long)1,sizeof(structbytea_1),ECPGd_EODT);
245246

246-
#line95 "bytea.pgc"
247+
#line96 "bytea.pgc"
247248

248249
if (sqlca.sqlcode<0)sqlprint();}
249-
#line95 "bytea.pgc"
250+
#line96 "bytea.pgc"
250251

251252
{ECPGset_desc(__LINE__,"idesc",2,ECPGd_data,
252253
ECPGt_bytea,&(send_buf[1]),(long)DATA_SIZE,(long)1,sizeof(structbytea_1),ECPGd_EODT);
253254

254-
#line96 "bytea.pgc"
255+
#line97 "bytea.pgc"
255256

256257
if (sqlca.sqlcode<0)sqlprint();}
257-
#line96 "bytea.pgc"
258+
#line97 "bytea.pgc"
258259

259260
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_execute,"ins_stmt",
260261
ECPGt_descriptor,"idesc",1L,1L,1L,
261262
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
262-
#line97 "bytea.pgc"
263+
#line98 "bytea.pgc"
263264

264265
if (sqlca.sqlcode<0)sqlprint();}
265-
#line97 "bytea.pgc"
266+
#line98 "bytea.pgc"
266267

267268
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_execute,"sel_stmt",ECPGt_EOIT,
268269
ECPGt_descriptor,"odesc",1L,1L,1L,
269270
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
270-
#line98 "bytea.pgc"
271+
#line99 "bytea.pgc"
271272

272273
if (sqlca.sqlcode<0)sqlprint();}
273-
#line98 "bytea.pgc"
274+
#line99 "bytea.pgc"
274275

275276
{ECPGget_desc(__LINE__,"odesc",1,ECPGd_indicator,
276277
ECPGt_int,&(ind[0]),(long)1,(long)1,sizeof(int),ECPGd_data,
277278
ECPGt_bytea,&(recv_buf[0]),(long)DATA_SIZE,(long)1,sizeof(structbytea_2),ECPGd_EODT);
278279

279-
#line99 "bytea.pgc"
280+
#line100 "bytea.pgc"
280281

281282
if (sqlca.sqlcode<0)sqlprint();}
282-
#line99 "bytea.pgc"
283+
#line100 "bytea.pgc"
283284

284285
{ECPGget_desc(__LINE__,"odesc",2,ECPGd_indicator,
285286
ECPGt_int,&(ind[1]),(long)1,(long)1,sizeof(int),ECPGd_data,
286287
ECPGt_bytea,&(recv_short_buf),(long)DATA_SIZE-LACK_SIZE,(long)1,sizeof(structbytea_4),ECPGd_EODT);
287288

288-
#line100 "bytea.pgc"
289+
#line101 "bytea.pgc"
289290

290291
if (sqlca.sqlcode<0)sqlprint();}
291-
#line100 "bytea.pgc"
292+
#line101 "bytea.pgc"
292293

293294
dump_binary(recv_buf[0].arr,recv_buf[0].len,ind[0]);
294295
dump_binary(recv_short_buf.arr,recv_short_buf.len,ind[1]);
295296

296297
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"drop table test",ECPGt_EOIT,ECPGt_EORT);
297-
#line104 "bytea.pgc"
298+
#line105 "bytea.pgc"
298299

299300
if (sqlca.sqlcode<0)sqlprint();}
300-
#line104 "bytea.pgc"
301+
#line105 "bytea.pgc"
301302

302303
{ECPGtrans(__LINE__,NULL,"commit");
303-
#line105 "bytea.pgc"
304+
#line106 "bytea.pgc"
304305

305306
if (sqlca.sqlcode<0)sqlprint();}
306-
#line105 "bytea.pgc"
307+
#line106 "bytea.pgc"
307308

308309
{ECPGdisconnect(__LINE__,"CURRENT");
309-
#line106 "bytea.pgc"
310+
#line107 "bytea.pgc"
310311

311312
if (sqlca.sqlcode<0)sqlprint();}
312-
#line106 "bytea.pgc"
313+
#line107 "bytea.pgc"
313314

314315

315316
return0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp