]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
log: don't fallback to stderr for out-of-memory situation
authorVincent Bernat <vincent@bernat.im>
Mon, 16 May 2016 06:55:34 +0000 (08:55 +0200)
committerVincent Bernat <vincent@bernat.im>
Mon, 16 May 2016 06:55:34 +0000 (08:55 +0200)
We don't know if "ap" is still valid. Just don't do anything.

src/log.c

index 1de756c7c62eca7e568354ebb73d76e205d59a18..8c85d5a111d64921c1acdeaaf6a47911e2bb8a3d 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -143,7 +143,12 @@ vlog(int pri, const char *token, const char *fmt, va_list ap)
                        free(result);
                        return;
                }
-               /* Otherwise, fallback to output on stderr. */
+               /* Otherwise, abort. We don't know if "ap" is still OK. We could
+                * have made a copy, but this is too much overhead for a
+                * situation that shouldn't happen. */
+               return;
+       }
+
        }
 
        /* Log to standard error in all cases */