Free dir pointer

This commit is contained in:
PolynomialDivision 2017-08-03 00:26:28 +02:00
parent 63a1432652
commit 1271a50eaf
3 changed files with 3 additions and 33 deletions

Binary file not shown.

View file

@ -1,33 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <libconfig.h>
int main(int argc, char **argv)
{
config_t cfg;
config_setting_t *root, *setting, *movie;
config_init(&cfg);
/* Read the file. If there is an error, report it and exit. */
if(! config_read_file(&cfg, "dawn.config"))
{
fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg),
config_error_line(&cfg), config_error_text(&cfg));
config_destroy(&cfg);
return(EXIT_FAILURE);
}
printf("READ CONFIG!!!\n");
root = config_root_setting(&cfg);
int ht_support;
if (config_lookup_int(&cfg, "ht_support", &ht_support))
printf("Broadcast Port: %d\n\n", ht_support);
else
fprintf(stderr, "No 'name' setting in configuration file.\n");
}

View file

@ -252,6 +252,7 @@ static int subscribe_to_hostapd_interfaces(char *hostapd_dir) {
add_subscriber(subscribe_name);
}
}
closedir(dirp);
// free(hostapd_dir); // free string
return 0;
}
@ -431,6 +432,7 @@ static int ubus_get_clients() {
}
}
}
closedir(dirp);
return 0;
}
@ -505,6 +507,7 @@ void del_client_all_interfaces(const uint8_t *client_addr, uint32_t reason, uint
}
}
}
closedir(dirp);
}
void del_client_interface(uint32_t id, const uint8_t *client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time) {