From: c vw <dl1ycf@darc.de>
Date: Fri, 3 Aug 2018 09:13:25 +0000 (+0200)
Subject: moved close up two lines to avoid segfaults.
X-Git-Url: https://git.rkrishnan.org/uri/htmlfontify-example.html?a=commitdiff_plain;h=4efaf1b1874abeb58c845dedab08d6410bedc2b0;p=pihpsdr.git

moved close up two lines to avoid segfaults.
---

diff --git a/stemlab_discovery.c b/stemlab_discovery.c
index 9f709e3..7b05b76 100644
--- a/stemlab_discovery.c
+++ b/stemlab_discovery.c
@@ -57,6 +57,8 @@ extern void status_text(const char *);
 
 #define ERROR_PREFIX "stemlab_discovery: "
 
+static size_t app_list_cb(void *buffer, size_t size, size_t nmemb, void *data);
+
 //
 // A bunch of callback-routines that use avahi, and are only needed by the
 // avahi-dependent version of stemlab_discovery(). These are only compiled
@@ -437,8 +439,8 @@ void stemlab_discovery() {
        p++;
      }
      if (len < 20) strcpy(inet,txt);
+     fclose(fpin);
    }
-   fclose(fpin);
    fprintf(stderr,"STEMLAB: using inet addr %s\n", inet);
    ip_address.sin_family = AF_INET;
    inet_aton(inet, &ip_address.sin_addr);