There are two cases which can cause memory leak during pass init/exit:
1. When resource initialization is failed, it just skips that
resource without putting it.
2. In the case of failure while freeing resources, it is also skipped
putting that resource.
To prevent memory leak, the resource will be put on both cases.
Change-Id: I4008b7785e0dbbc318b38eb573bf739e0a848b6c
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
if (ret < 0) {
_E("Cannot initialize the pass '%s' resource (%d)\n",
cdata->res_name, ret);
+
+ ret = pass_put_resource(pass_res);
+ if (ret < 0)
+ _E("Cannot put the pass '%s' resource (%d)\n",
+ cdata->res_name, ret);
continue;
}
}
struct pass_conf_data *cdata = &g_pass.res[i].cdata;
ret = pass_resource_exit(pass_res);
- if (ret < 0) {
+ if (ret < 0)
_E("Cannot exit the pass '%s' resource (%d)\n",
cdata->res_name, ret);
- continue;
- }
ret = pass_put_resource(pass_res);
if (ret < 0) {