Fossil SCM

moved some db_finalize() calls so that they would also be called in error cases.

stephan 2011-09-28 22:41 UTC json
Commit 997274e9be9203c9a4cda6a119d9c30ef25253ed
1 file changed +3 -3
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -354,18 +354,18 @@
354354
if(flist){
355355
cson_object_set(row,"files",flist);
356356
}
357357
}
358358
}
359
- db_finalize(&q);
360359
#undef SET
361360
goto ok;
362361
error:
363362
assert( 0 != g.json.resultCode );
364363
cson_value_free(payV);
365364
payV = NULL;
366365
ok:
366
+ db_finalize(&q);
367367
return payV;
368368
}
369369
370370
/*
371371
** Implementation of /json/timeline/wiki.
@@ -439,18 +439,18 @@
439439
? FSL_JSON_E_ALLOC
440440
: FSL_JSON_E_UNKNOWN;
441441
goto error;
442442
}
443443
}
444
- db_finalize(&q);
445444
#undef SET
446445
goto ok;
447446
error:
448447
assert( 0 != g.json.resultCode );
449448
cson_value_free(payV);
450449
payV = NULL;
451450
ok:
451
+ db_finalize(&q);
452452
return payV;
453453
}
454454
455455
/*
456456
** Implementation of /json/timeline/ticket.
@@ -532,16 +532,16 @@
532532
? FSL_JSON_E_ALLOC
533533
: FSL_JSON_E_UNKNOWN;
534534
goto error;
535535
}
536536
}
537
- db_finalize(&q);
538537
#undef SET
539538
goto ok;
540539
error:
541540
assert( 0 != g.json.resultCode );
542541
cson_value_free(payV);
543542
payV = NULL;
544543
ok:
544
+ db_finalize(&q);
545545
return payV;
546546
}
547547
548548
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -354,18 +354,18 @@
354 if(flist){
355 cson_object_set(row,"files",flist);
356 }
357 }
358 }
359 db_finalize(&q);
360 #undef SET
361 goto ok;
362 error:
363 assert( 0 != g.json.resultCode );
364 cson_value_free(payV);
365 payV = NULL;
366 ok:
 
367 return payV;
368 }
369
370 /*
371 ** Implementation of /json/timeline/wiki.
@@ -439,18 +439,18 @@
439 ? FSL_JSON_E_ALLOC
440 : FSL_JSON_E_UNKNOWN;
441 goto error;
442 }
443 }
444 db_finalize(&q);
445 #undef SET
446 goto ok;
447 error:
448 assert( 0 != g.json.resultCode );
449 cson_value_free(payV);
450 payV = NULL;
451 ok:
 
452 return payV;
453 }
454
455 /*
456 ** Implementation of /json/timeline/ticket.
@@ -532,16 +532,16 @@
532 ? FSL_JSON_E_ALLOC
533 : FSL_JSON_E_UNKNOWN;
534 goto error;
535 }
536 }
537 db_finalize(&q);
538 #undef SET
539 goto ok;
540 error:
541 assert( 0 != g.json.resultCode );
542 cson_value_free(payV);
543 payV = NULL;
544 ok:
 
545 return payV;
546 }
547
548
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -354,18 +354,18 @@
354 if(flist){
355 cson_object_set(row,"files",flist);
356 }
357 }
358 }
 
359 #undef SET
360 goto ok;
361 error:
362 assert( 0 != g.json.resultCode );
363 cson_value_free(payV);
364 payV = NULL;
365 ok:
366 db_finalize(&q);
367 return payV;
368 }
369
370 /*
371 ** Implementation of /json/timeline/wiki.
@@ -439,18 +439,18 @@
439 ? FSL_JSON_E_ALLOC
440 : FSL_JSON_E_UNKNOWN;
441 goto error;
442 }
443 }
 
444 #undef SET
445 goto ok;
446 error:
447 assert( 0 != g.json.resultCode );
448 cson_value_free(payV);
449 payV = NULL;
450 ok:
451 db_finalize(&q);
452 return payV;
453 }
454
455 /*
456 ** Implementation of /json/timeline/ticket.
@@ -532,16 +532,16 @@
532 ? FSL_JSON_E_ALLOC
533 : FSL_JSON_E_UNKNOWN;
534 goto error;
535 }
536 }
 
537 #undef SET
538 goto ok;
539 error:
540 assert( 0 != g.json.resultCode );
541 cson_value_free(payV);
542 payV = NULL;
543 ok:
544 db_finalize(&q);
545 return payV;
546 }
547
548

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button