mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 03:03:02 +01:00
fix potential memory issue
This commit is contained in:
parent
4a8146b943
commit
26d691f021
3
main.c
3
main.c
@ -306,10 +306,7 @@ int main(int argc, char *argv[])
|
|||||||
config_err = create_user_config_dir(user_config_dir);
|
config_err = create_user_config_dir(user_config_dir);
|
||||||
|
|
||||||
if (config_err) {
|
if (config_err) {
|
||||||
strcat(DATA_FILE, dir);
|
|
||||||
DATA_FILE = strdup("data");
|
DATA_FILE = strdup("data");
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1);
|
DATA_FILE = malloc(strlen(user_config_dir) + strlen(CONFIGDIR) + strlen("data") + 1);
|
||||||
strcpy(DATA_FILE, user_config_dir);
|
strcpy(DATA_FILE, user_config_dir);
|
||||||
|
Loading…
Reference in New Issue
Block a user