Fix two small memory leaks.
[oweals/tinc.git] / src / dummy_device.c
index 9dd3fae784668b3fd87392ada4591851ec33cf90..d1d751beaa2dff60ea26d1f72ab1d747b1bd5864 100644 (file)
 #include "device.h"
 #include "logger.h"
 #include "net.h"
+#include "xalloc.h"
 
-static char *device_info = "dummy device";
+static const char *device_info = "dummy device";
 
 static uint64_t device_total_in = 0;
 static uint64_t device_total_out = 0;
 
 static bool setup_device(void) {
-       device = "dummy";
-       iface = "dummy";
+       device = xstrdup("dummy");
+       iface = xstrdup("dummy");
        logger(LOG_INFO, "%s (%s) is a %s", device, iface, device_info);
        return true;
 }
 
 static void close_device(void) {
+       free(device);
+       free(iface);
 }
 
 static bool read_packet(vpn_packet_t *packet) {
+       (void)packet;
        return false;
 }