[Git][NTPsec/ntpsec][master] libisc: add back lost va_end(), fixes CID 164518.

Gary E. Miller gitlab at mg.gitlab.com
Tue Jun 6 22:37:17 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
88b9cc77 by Gary E. Miller at 2017-06-06T15:35:32-07:00
libisc: add back lost va_end(), fixes CID 164518.

- - - - -


1 changed file:

- libisc/error.c


Changes:

=====================================
libisc/error.c
=====================================
--- a/libisc/error.c
+++ b/libisc/error.c
@@ -21,19 +21,20 @@
 #define MAX_UNEXPECTED_ERRORS 100
 void
 isc_error_unexpected(const char *file, int line, const char *format, ...) {
-	va_list args;
-	char errbuf[256];
-	static int unexpected_error_cnt = 0;
+        va_list args;
+        char errbuf[256];
+        static int unexpected_error_cnt = 0;
 
-	va_start(args, format);
+        va_start(args, format);
 
-	if (unexpected_error_cnt >= MAX_UNEXPECTED_ERRORS)
-		return;	/* avoid clutter in log */
+        if (unexpected_error_cnt >= MAX_UNEXPECTED_ERRORS)
+                return; /* avoid clutter in log */
 
-	msyslog(LOG_ERR, "%s:%d: unexpected error:", file, line);
-	vsnprintf(errbuf, sizeof(errbuf), format, args);
-	msyslog(LOG_ERR, "%s", errbuf);
+        msyslog(LOG_ERR, "%s:%d: unexpected error:", file, line);
+        vsnprintf(errbuf, sizeof(errbuf), format, args);
+        msyslog(LOG_ERR, "%s", errbuf);
 
-	if (++unexpected_error_cnt == MAX_UNEXPECTED_ERRORS)
-		msyslog(LOG_ERR, "Too many errors.  Shutting up.");
+        if (++unexpected_error_cnt == MAX_UNEXPECTED_ERRORS)
+                msyslog(LOG_ERR, "Too many errors.  Shutting up.");
+        va_end(args);
 }



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/88b9cc7755723008f4b4628dc655796ba21f2381

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/88b9cc7755723008f4b4628dc655796ba21f2381
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170606/0749b62e/attachment.html>


More information about the vc mailing list