profile: fixed resource leak

This commit is contained in:
Frank Morgner 2015-04-29 23:22:29 +02:00 committed by Viktor Tarasov
parent 6cb99be821
commit 01e573b987

View File

@ -380,11 +380,15 @@ sc_profile_load(struct sc_profile *profile, const char *filename)
sc_log(ctx, "profile %s loaded ok", path);
if (res < 0)
if (res < 0) {
scconf_free(conf);
LOG_FUNC_RETURN(ctx, SC_ERROR_FILE_NOT_FOUND);
}
if (res == 0)
if (res == 0) {
scconf_free(conf);
LOG_FUNC_RETURN(ctx, SC_ERROR_SYNTAX_ERROR);
}
res = process_conf(profile, conf);
scconf_free(conf);