diff --git a/fs/exec.c b/fs/exec.c index ef18eb0ea5b4..df70ed8e36fe 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1496,7 +1496,8 @@ static void free_bprm(struct linux_binprm *bprm) if (bprm->interp != bprm->filename) kfree(bprm->interp); kfree(bprm->fdpath); - kfree(bprm->argv0); + if (!IS_ERR(bprm->argv0)) + kfree(bprm->argv0); kfree(bprm); }