]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
moved close up two lines to avoid segfaults.
authorc vw <dl1ycf@darc.de>
Fri, 3 Aug 2018 09:13:25 +0000 (11:13 +0200)
committerc vw <dl1ycf@darc.de>
Fri, 3 Aug 2018 09:13:25 +0000 (11:13 +0200)
stemlab_discovery.c

index 9f709e3bb6fcebc20a3d747f2de284c2a9eaca5f..7b05b7687ed7389c9fe40519168ae7e410890c4a 100644 (file)
@@ -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);