Added an option to manually specify which address to bind to.
[distributedratelimiting.git] / drl / util.c
index c03eced..bf4862a 100644 (file)
@@ -301,8 +301,8 @@ char* get_local_ip(){
         } else {
             if (localip == NULL) {
                 localip = malloc(STRINGSIZE);
+                strncpy(localip, ip, STRINGSIZE);
             }
-            strncpy(localip, ip, STRINGSIZE);
         }
     }
     freeifaddrs(ifp);