mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
plugins/python/python_plugin_approval: fix negative ref count
The python_plugin_api_rc_call function already decrements the refcount of py_args. Python avoids the double free, but the error gets shown if using python debug build.
This commit is contained in:
committed by
Todd C. Miller
parent
a71828b385
commit
efa97b5b97
@@ -131,10 +131,10 @@ python_plugin_approval_check(struct ApprovalPluginContext *approval_ctx,
|
||||
py_args = Py_BuildValue("(OOO)", py_command_info, py_run_argv, py_run_envp);
|
||||
}
|
||||
|
||||
// Note, py_args gets cleared by api_rc_call
|
||||
rc = python_plugin_api_rc_call(plugin_ctx, CALLBACK_PYNAME(check), py_args);
|
||||
CALLBACK_SET_ERROR(plugin_ctx, errstr);
|
||||
|
||||
Py_CLEAR(py_args);
|
||||
Py_CLEAR(py_command_info);
|
||||
Py_CLEAR(py_run_argv);
|
||||
Py_CLEAR(py_run_envp);
|
||||
|
Reference in New Issue
Block a user