Avoid memory leaks when overwriting existing values
This commit is contained in:
parent
e66d412682
commit
a86b9ed02e
|
@ -150,7 +150,11 @@ int config_set(Config * config, char const * section, char const * variable,
|
||||||
string_delete(newvalue);
|
string_delete(newvalue);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
string_delete(oldvalue);
|
if(oldvalue != NULL)
|
||||||
|
{
|
||||||
|
string_delete(p);
|
||||||
|
string_delete(oldvalue);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user