Browse Source

tdb2: log an error when out of memory formatting message.

Log it at level ERROR and log the raw unformatted message at the requested
level.
Rusty Russell 15 years ago
parent
commit
8da574fe7c
1 changed files with 3 additions and 2 deletions
  1. 3 2
      ccan/tdb2/tdb.c

+ 3 - 2
ccan/tdb2/tdb.c

@@ -737,8 +737,9 @@ void COLD tdb_logerr(struct tdb_context *tdb,
 
 	message = malloc(len + 1);
 	if (!message) {
-		tdb->logfn(tdb, level, tdb->log_private,
-			   "out of memory formatting message");
+		tdb->logfn(tdb, TDB_DEBUG_ERROR, tdb->log_private,
+			   "out of memory formatting message:");
+		tdb->logfn(tdb, level, tdb->log_private, fmt);
 		return;
 	}
 	va_start(ap, fmt);