Fossil SCM

Fix harmless memory leaks.

drh 2016-10-31 12:41 trunk
Commit 36babe0ce135122d4028dbb962ee28d2a21ae78e
2 files changed +1 +1
+1
--- src/db.c
+++ src/db.c
@@ -1281,10 +1281,11 @@
12811281
}
12821282
if( db_local_table_exists_but_lacks_column("undo_vfile", "islink") ){
12831283
db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOL DEFAULT 0");
12841284
}
12851285
}
1286
+ fossil_free(zVFileDef);
12861287
return 1;
12871288
}
12881289
12891290
/*
12901291
** Locate the root directory of the local repository tree. The root
12911292
--- src/db.c
+++ src/db.c
@@ -1281,10 +1281,11 @@
1281 }
1282 if( db_local_table_exists_but_lacks_column("undo_vfile", "islink") ){
1283 db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOL DEFAULT 0");
1284 }
1285 }
 
1286 return 1;
1287 }
1288
1289 /*
1290 ** Locate the root directory of the local repository tree. The root
1291
--- src/db.c
+++ src/db.c
@@ -1281,10 +1281,11 @@
1281 }
1282 if( db_local_table_exists_but_lacks_column("undo_vfile", "islink") ){
1283 db_multi_exec("ALTER TABLE undo_vfile ADD COLUMN islink BOOL DEFAULT 0");
1284 }
1285 }
1286 fossil_free(zVFileDef);
1287 return 1;
1288 }
1289
1290 /*
1291 ** Locate the root directory of the local repository tree. The root
1292
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -412,10 +412,11 @@
412412
" ORDER BY pathname /*scan*/",
413413
vid
414414
);
415415
}
416416
db_prepare(&q, "%s", blob_sql_text(&sql));
417
+ blob_reset(&sql);
417418
while( db_step(&q)==SQLITE_ROW ){
418419
const char *zPathname = db_column_text(&q,0);
419420
int isDeleted = db_column_int(&q, 1);
420421
int isChnged = db_column_int(&q,2);
421422
int isNew = db_column_int(&q,3);
422423
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -412,10 +412,11 @@
412 " ORDER BY pathname /*scan*/",
413 vid
414 );
415 }
416 db_prepare(&q, "%s", blob_sql_text(&sql));
 
417 while( db_step(&q)==SQLITE_ROW ){
418 const char *zPathname = db_column_text(&q,0);
419 int isDeleted = db_column_int(&q, 1);
420 int isChnged = db_column_int(&q,2);
421 int isNew = db_column_int(&q,3);
422
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -412,10 +412,11 @@
412 " ORDER BY pathname /*scan*/",
413 vid
414 );
415 }
416 db_prepare(&q, "%s", blob_sql_text(&sql));
417 blob_reset(&sql);
418 while( db_step(&q)==SQLITE_ROW ){
419 const char *zPathname = db_column_text(&q,0);
420 int isDeleted = db_column_int(&q, 1);
421 int isChnged = db_column_int(&q,2);
422 int isNew = db_column_int(&q,3);
423

Keyboard Shortcuts

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