~ubuntu-branches/ubuntu/wily/libxml2/wily-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0025-Fix-an-fd-leak-in-an-error-case.patch

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2014-10-26 07:04:50 UTC
  • mfrom: (43.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20141026070450-rmcqvcqn8peeuebs
Tags: 2.9.2+dfsg1-1
* New upstream release (Closes: #765722, CVE-2014-3660)
* Remove no-longer-needed upstream patches
* Update distro patch
* Std-ver: 3.9.5 -> 3.9.6, no change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Daniel Veillard <veillard@redhat.com>
2
 
Date: Thu, 6 Feb 2014 10:38:00 +0100
3
 
Subject: Fix an fd leak in an error case
4
 
 
5
 
---
6
 
 catalog.c |    5 +++++
7
 
 1 file changed, 5 insertions(+)
8
 
 
9
 
diff --git a/catalog.c b/catalog.c
10
 
index 8e34cd2..56991da 100644
11
 
--- a/catalog.c
12
 
+++ b/catalog.c
13
 
@@ -994,6 +994,11 @@ xmlLoadFileContent(const char *filename)
14
 
     content = (xmlChar*)xmlMallocAtomic(size + 10);
15
 
     if (content == NULL) {
16
 
         xmlCatalogErrMemory("allocating catalog data");
17
 
+#ifdef HAVE_STAT
18
 
+       close(fd);
19
 
+#else
20
 
+       fclose(fd);
21
 
+#endif
22
 
         return (NULL);
23
 
     }
24
 
 #ifdef HAVE_STAT