gnunet-svn
[Top][All Lists]
Advanced

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

[gnurl] 332/411: mqttd: fclose test file when done


From: gnunet
Subject: [gnurl] 332/411: mqttd: fclose test file when done
Date: Wed, 13 Jan 2021 01:22:27 +0100

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

nikita pushed a commit to branch master
in repository gnurl.

commit 3c5c6e7477dacdd0efd76d5681e813b88c506abc
Author: Daniel Stenberg <daniel@haxx.se>
AuthorDate: Mon Nov 9 08:49:59 2020 +0100

    mqttd: fclose test file when done
    
    Reported-by: Marc Hörsken
    Reviewed-by: Jay Satiro
    Bug: #6058
    Closes #6189
---
 tests/server/mqttd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c
index f0c768ed8..1f4344ac0 100644
--- a/tests/server/mqttd.c
+++ b/tests/server/mqttd.c
@@ -486,6 +486,7 @@ static curl_socket_t mqttit(curl_socket_t fd)
   size_t bytes = 0; /* remaining length field size in bytes */
   char client_id[MAX_CLIENT_ID_LENGTH];
   long testno;
+  FILE *stream = NULL;
 
   static const char protocol[7] = {
     0x00, 0x04,       /* protocol length */
@@ -550,7 +551,6 @@ static curl_socket_t mqttit(curl_socket_t fd)
       }
     }
     else if(byte == MQTT_MSG_SUBSCRIBE) {
-      FILE *stream;
       int error;
       char *data;
       size_t datalen;
@@ -636,7 +636,10 @@ static curl_socket_t mqttit(curl_socket_t fd)
   } while(1);
 
   end:
-  fclose(dump);
+  if(dump)
+    fclose(dump);
+  if(stream)
+    fclose(stream);
   return CURL_SOCKET_BAD;
 }
 

-- 
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]