projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move free()s at the end om main() to the proper destructor functions.
[tinc]
/
src
/
raw_socket
/
device.c
diff --git
a/src/raw_socket/device.c
b/src/raw_socket/device.c
index
b96f06f
..
9e306b3
100644
(file)
--- a/
src/raw_socket/device.c
+++ b/
src/raw_socket/device.c
@@
-32,8
+32,8
@@
#include "xalloc.h"
int device_fd = -1;
#include "xalloc.h"
int device_fd = -1;
-char *device;
-char *iface;
+char *device
= NULL
;
+char *iface
= NULL
;
static char ifrname[IFNAMSIZ];
static char *device_info;
static char ifrname[IFNAMSIZ];
static char *device_info;
@@
-90,6
+90,9
@@
void close_device(void)
cp();
close(device_fd);
cp();
close(device_fd);
+
+ free(device);
+ free(iface);
}
bool read_packet(vpn_packet_t *packet)
}
bool read_packet(vpn_packet_t *packet)