If an error is returned without zeroing a pre-allocated @info pointer,
then marshalling of the response will fail.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10984
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
/* that's an [in out] buffer */
if (!r->in.buffer && (r->in.offered != 0)) {
/* that's an [in out] buffer */
if (!r->in.buffer && (r->in.offered != 0)) {
- return WERR_INVALID_PARAM;
+ result = WERR_INVALID_PARAM;
+ goto err_info_free;
}
DEBUG(5,("_spoolss_GetPrintProcessorDirectory: level %d\n",
}
DEBUG(5,("_spoolss_GetPrintProcessorDirectory: level %d\n",
snum = find_service(talloc_tos(), "prnproc$", &prnproc_share);
if (!prnproc_share) {
snum = find_service(talloc_tos(), "prnproc$", &prnproc_share);
if (!prnproc_share) {
+ result = WERR_NOMEM;
+ goto err_info_free;
}
if (snum != -1) {
prnproc_share_exists = true;
}
if (snum != -1) {
prnproc_share_exists = true;
r->in.environment,
&r->out.info->info1);
if (!W_ERROR_IS_OK(result)) {
r->in.environment,
&r->out.info->info1);
if (!W_ERROR_IS_OK(result)) {
- TALLOC_FREE(r->out.info);
- return result;
}
*r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_PrintProcessorDirectoryInfo,
}
*r->out.needed = SPOOLSS_BUFFER_UNION(spoolss_PrintProcessorDirectoryInfo,
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
r->out.info = SPOOLSS_BUFFER_OK(r->out.info, NULL);
return SPOOLSS_BUFFER_OK(WERR_OK, WERR_INSUFFICIENT_BUFFER);
+
+err_info_free:
+ TALLOC_FREE(r->out.info);
+ return result;
}
/*******************************************************************
}
/*******************************************************************