tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
This commit is contained in:
@@ -46,7 +46,7 @@ static int netdev_fill_tuntap_message(NetDev *netdev, struct ifreq *ifr) {
|
||||
}
|
||||
|
||||
static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) {
|
||||
_cleanup_close_ int fd;
|
||||
_cleanup_close_ int fd = -1;
|
||||
TunTap *t = NULL;
|
||||
const char *user;
|
||||
const char *group;
|
||||
|
||||
Reference in New Issue
Block a user