Add an error flag to the lbuf struct to simplify error checking.

Callers of the lbuf functions now check the error flag to tell if
a memory allocation error ocurred.
This commit is contained in:
Todd C. Miller
2015-06-26 15:58:04 -06:00
parent 2751413464
commit 54f9de6cce
7 changed files with 104 additions and 25 deletions

View File

@@ -1317,6 +1317,8 @@ sudo_sss_display_defaults(struct sudo_nss *nss, struct passwd *pw,
handle->fn_free_result(sss_result);
done:
if (sudo_lbuf_error(lbuf))
debug_return_int(-1);
debug_return_int(count);
}
@@ -1572,6 +1574,8 @@ sudo_sss_display_privs(struct sudo_nss *nss, struct passwd *pw,
if (sss_result != NULL)
handle->fn_free_result(sss_result);
if (sudo_lbuf_error(lbuf))
debug_return_int(-1);
debug_return_int(count);
}