Re: [PATCH] trivial patch for stf.c



On Mon, Jun 03, 2002 at 04:42:04PM -0500, Art Haas wrote:
Hi.

Here's a patch that will close a file descriptor leak in
an error condition. This patch is based on the code in
the gnome_1_4 tag (gnumeric 1.0.X).

Thanks for all the work on Gnumeric - it's a great spreadsheet.

Index: stf.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/stf.c,v
retrieving revision 1.37.2.4
diff -u -r1.37.2.4 stf.c
--- stf.c     2 Jun 2002 00:08:32 -0000       1.37.2.4
+++ stf.c     3 Jun 2002 21:37:26 -0000
@@ -90,6 +90,7 @@
       */
      data = calloc (1, sbuf.st_size + 1);
      if (!data)
+             close (fd);
              return NULL;
 
      /*

Thanks, I'll apply something similar (don't forget the braces !) to
the next release.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]