rval = ber_decode(&s_codec_ctx, descriptor, result, buffer,
buffer_size);
if (rval.code != RC_OK) {
+ if (rval.code == RC_FAIL && errno == ENOMEM)
+ pr_enomem();
+
/* Must free partial object according to API contracts. */
ASN_STRUCT_FREE(*descriptor, *result);
/* We expect the data to be complete; RC_WMORE is an error. */
int
pr_op_errno(int error, const char *format, ...)
{
+ if (abs(error) == ENOMEM)
+ pr_enomem();
+
PR_OP_SIMPLE(LOG_ERR);
return pr_errno(error, op_syslog_enabled,
int
pr_val_errno(int error, const char *format, ...)
{
+ if (abs(error) == ENOMEM)
+ pr_enomem();
+
PR_VAL_SIMPLE(LOG_ERR);
return pr_errno(error, val_syslog_enabled,
__fprintf(LOG_ERR, config_get_op_log_tag(),
config_get_op_log_color_output(),
"Out of memory.\n");
- return -ENOMEM;
+ print_stack_trace();
+ exit(ENOMEM);
}
/**
/* Happy path (but also sad path sometimes). */
error = WEXITSTATUS(child_status);
pr_val_debug("Child terminated with error code %d.", error);
+ if (error == ENOMEM)
+ pr_enomem();
+
if (!error)
goto release_args;
error = send_cache_reset_pdu(fd, version);
goto end;
case -ENOMEM: /* Memory allocation failure */
+ pr_enomem();
goto end;
case EAGAIN: /* Too many threads */
/*