]> granicus.if.org Git - transmission/commitdiff
in debugf(), don't call fflush() on a null pointer. Xref: https://trac.transmissionbt...
authorJordan Lee <jordan@transmissionbt.com>
Sun, 19 Jan 2014 04:26:45 +0000 (04:26 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 19 Jan 2014 04:26:45 +0000 (04:26 +0000)
third-party/dht/dht.c

index 37d48ba0fd672e07e41e0819f425eceb65f5330b..fa7a959c1c1bcd6d4ce1c9b55877f4e341a8c88c 100644 (file)
@@ -326,10 +326,11 @@ debugf(const char *format, ...)
 {
     va_list args;
     va_start(args, format);
-    if(dht_debug)
+    if(dht_debug) {
         vfprintf(dht_debug, format, args);
+        fflush(dht_debug);
+    }
     va_end(args);
-    fflush(dht_debug);
 }
 
 static void