log BUGFIX special no-memory error handling
Fixes #1546
diff --git a/src/log.c b/src/log.c
index 0b28570..b842cbd 100644
--- a/src/log.c
+++ b/src/log.c
@@ -419,6 +419,25 @@
return;
}
+ if (no == LY_EMEM) {
+ /* just print it, anything else would most likely fail anyway */
+ if (ly_log_opts & LY_LOLOG) {
+ if (log_clb) {
+ log_clb(level, LY_EMEM_MSG, path);
+ } else {
+ fprintf(stderr, "libyang[%d]: ", level);
+ vfprintf(stderr, format, args);
+ if (path) {
+ fprintf(stderr, " (path: %s)\n", path);
+ } else {
+ fprintf(stderr, "\n");
+ }
+ }
+ }
+ free(path);
+ return;
+ }
+
/* store the error/warning (if we need to store errors internally, it does not matter what are the user log options) */
if ((level < LY_LLVRB) && ctx && (ly_log_opts & LY_LOSTORE)) {
assert(format);