You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by br...@apache.org on 2014/07/15 05:15:32 UTC

git commit: TS-1475: Close file descriptor after diff. Coverity #1021825

Repository: trafficserver
Updated Branches:
  refs/heads/master 5ba08de9a -> edae44a0a


TS-1475: Close file descriptor after diff. Coverity #1021825


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/edae44a0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/edae44a0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/edae44a0

Branch: refs/heads/master
Commit: edae44a0afa2869a68cce2b9496639658b609515
Parents: 5ba08de
Author: Brian Geffon <br...@apache.org>
Authored: Mon Jul 14 15:53:51 2014 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Mon Jul 14 20:15:03 2014 -0700

----------------------------------------------------------------------
 lib/ts/IpMapConf.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/edae44a0/lib/ts/IpMapConf.cc
----------------------------------------------------------------------
diff --git a/lib/ts/IpMapConf.cc b/lib/ts/IpMapConf.cc
index 97878b4..a331610 100644
--- a/lib/ts/IpMapConf.cc
+++ b/lib/ts/IpMapConf.cc
@@ -78,8 +78,9 @@ Load_IpMap_From_File(IpMap* map, int fd, const char *key_str)
   char* zret = 0;
   FILE* f = fdopen(dup(fd), "r"); // dup so we don't close the original fd.
 
-  if (f) {
+  if (f != NULL) {
     zret = Load_IpMap_From_File(map, f, key_str);
+    fclose(f);
   } else {
     zret = (char *)ats_malloc(ERR_STRING_LEN);
     snprintf(zret, ERR_STRING_LEN, "Unable to reopen file descriptor as stream %d:%s", errno, strerror(errno));