gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: -fix FD leak


From: gnunet
Subject: [taler-merchant] branch master updated: -fix FD leak
Date: Thu, 03 Aug 2023 18:48:41 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 6fa47d8a -fix FD leak
6fa47d8a is described below

commit 6fa47d8acc71079130a4f02a0dc5becaadb9446d
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Thu Aug 3 18:48:36 2023 +0200

    -fix FD leak
---
 src/backend/taler-merchant-httpd_spa.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_spa.c 
b/src/backend/taler-merchant-httpd_spa.c
index 1c095333..b12200b8 100644
--- a/src/backend/taler-merchant-httpd_spa.c
+++ b/src/backend/taler-merchant-httpd_spa.c
@@ -118,13 +118,7 @@ static enum GNUNET_GenericReturnValue
 build_webui (void *cls,
              const char *dn)
 {
-  int fd;
-  struct stat sb;
-  struct MHD_Response *zspa = NULL;
-  struct MHD_Response *spa;
-  const char *ext;
-  const char *mime;
-  struct
+  static struct
   {
     const char *ext;
     const char *mime;
@@ -162,6 +156,12 @@ build_webui (void *cls,
       .mime = NULL
     },
   };
+  int fd;
+  struct stat sb;
+  struct MHD_Response *zspa = NULL;
+  struct MHD_Response *spa;
+  const char *ext;
+  const char *mime;
 
   (void) cls;
   /* finally open template */
@@ -188,8 +188,10 @@ build_webui (void *cls,
   mime = NULL;
   ext = strrchr (dn, '.');
   if (NULL == ext)
+  {
+    GNUNET_break (0 == close (fd));
     return GNUNET_OK;
-
+  }
   ext++;
   for (unsigned int i = 0; NULL != mime_map[i].ext; i++)
     if (0 == strcasecmp (ext,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]