Browse code

add missing fclose() in cdiff_cmd_close()

git-svn: trunk@2116

Tomasz Kojm authored on 2006/07/25 04:07:20
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Jul 24 21:05:20 CEST 2006 (tk)
2
+----------------------------------
3
+  * shared/cdiff.c: add missing fclose() in cdiff_cmd_close()
4
+
1 5
 Mon Jul 24 13:13:35 BST 2006 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Some HTML.Phishing.Bank-598 were not being caught,
... ...
@@ -151,7 +151,6 @@ static char *cdiff_token(const char *line, unsigned int token)
151 151
 static int cdiff_cmd_open(const char *cmdstr, struct cdiff_ctx *ctx)
152 152
 {
153 153
 	char *db;
154
-	struct stat sb;
155 154
 	unsigned int i;
156 155
 
157 156
 
... ...
@@ -174,12 +173,6 @@ static int cdiff_cmd_open(const char *cmdstr, struct cdiff_ctx *ctx)
174 174
 	}
175 175
     }
176 176
 
177
-    if(stat(db, &sb) == -1) {
178
-	logg("!cdiff_cmd_open: Can't stat database file %s\n", db);
179
-	free(db);
180
-	return -1;
181
-    }
182
-
183 177
     ctx->open_db = db;
184 178
     return 0;
185 179
 }
... ...
@@ -463,6 +456,8 @@ static int cdiff_cmd_close(const char *cmdstr, struct cdiff_ctx *ctx)
463 463
 	    }
464 464
 	    add = add->next;
465 465
 	}
466
+
467
+	fclose(fh);
466 468
     }
467 469
 
468 470
     cdiff_ctx_free(ctx);