Fix premature free
Do not free help filename before the open check as it is used in the error message.
This commit is contained in:
parent
27d4c5849e
commit
5acda539f7
|
@ -37,11 +37,12 @@ static void discord_help_init()
|
|||
/* Load help from our own help file. */
|
||||
help_t *dh;
|
||||
help_init(&dh, df);
|
||||
g_free(df);
|
||||
if(dh == NULL) {
|
||||
log_message(LOGLVL_WARNING, "Error opening helpfile %s.", df);
|
||||
log_message(LOGLVL_WARNING, "Error opening helpfile: %s.", df);
|
||||
g_free(df);
|
||||
return;
|
||||
}
|
||||
g_free(df);
|
||||
|
||||
/* Link the last entry of global.help with first entry of our help. */
|
||||
help_t *h, *l = NULL;
|
||||
|
|
Loading…
Reference in New Issue