Fossil SCM

Fix memory leak from previous commit

baruch 2016-01-21 10:32 pending-review
Commit 9ab7122d6a00c7bd017727434983104a3997c181
1 file changed +4 -3
+4 -3
--- src/timeline.c
+++ src/timeline.c
@@ -1752,20 +1752,21 @@
17521752
"SELECT count(*) FROM timeline WHERE etype!='div'"
17531753
" AND sortby<=%f /*scan*/", rCirca);
17541754
nAfter = db_int(0,
17551755
"SELECT count(*) FROM timeline WHERE etype!='div'"
17561756
" AND sortby>=%f /*scan*/", rCirca);
1757
- zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
17581757
if( nBefore>=nEntry ){
1758
+ zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
17591759
timeline_submenu(&url, "Older", "b", zDate, "c");
17601760
zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "c", 0));
1761
+ free(zDate);
17611762
}
1762
- zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
17631763
if( nAfter>=nEntry ){
1764
+ zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
17641765
timeline_submenu(&url, "Newer", "a", zDate, "c");
1766
+ free(zDate);
17651767
}
1766
- free(zDate);
17671768
}else{
17681769
if( zAfter || n==nEntry ){
17691770
zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
17701771
timeline_submenu(&url, "Older", "b", zDate, "a");
17711772
zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0));
17721773
--- src/timeline.c
+++ src/timeline.c
@@ -1752,20 +1752,21 @@
1752 "SELECT count(*) FROM timeline WHERE etype!='div'"
1753 " AND sortby<=%f /*scan*/", rCirca);
1754 nAfter = db_int(0,
1755 "SELECT count(*) FROM timeline WHERE etype!='div'"
1756 " AND sortby>=%f /*scan*/", rCirca);
1757 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1758 if( nBefore>=nEntry ){
 
1759 timeline_submenu(&url, "Older", "b", zDate, "c");
1760 zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "c", 0));
 
1761 }
1762 zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
1763 if( nAfter>=nEntry ){
 
1764 timeline_submenu(&url, "Newer", "a", zDate, "c");
 
1765 }
1766 free(zDate);
1767 }else{
1768 if( zAfter || n==nEntry ){
1769 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1770 timeline_submenu(&url, "Older", "b", zDate, "a");
1771 zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0));
1772
--- src/timeline.c
+++ src/timeline.c
@@ -1752,20 +1752,21 @@
1752 "SELECT count(*) FROM timeline WHERE etype!='div'"
1753 " AND sortby<=%f /*scan*/", rCirca);
1754 nAfter = db_int(0,
1755 "SELECT count(*) FROM timeline WHERE etype!='div'"
1756 " AND sortby>=%f /*scan*/", rCirca);
 
1757 if( nBefore>=nEntry ){
1758 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1759 timeline_submenu(&url, "Older", "b", zDate, "c");
1760 zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "c", 0));
1761 free(zDate);
1762 }
 
1763 if( nAfter>=nEntry ){
1764 zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
1765 timeline_submenu(&url, "Newer", "a", zDate, "c");
1766 free(zDate);
1767 }
 
1768 }else{
1769 if( zAfter || n==nEntry ){
1770 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1771 timeline_submenu(&url, "Older", "b", zDate, "a");
1772 zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0));
1773

Keyboard Shortcuts

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