From a720b6c9dc8639b3504573384590c3cfb7063387 Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Mon, 16 Apr 2018 19:54:51 +0200 Subject: [PATCH] p/multicpu1sec-c: fix stackoverflow in acquire() When acquire() cannot open/create the cache file, it wrongly called itself. A fatal error is now thrown instead --- plugins/cpu/multicpu1sec-c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/cpu/multicpu1sec-c.c b/plugins/cpu/multicpu1sec-c.c index c1f72574..497d1a28 100644 --- a/plugins/cpu/multicpu1sec-c.c +++ b/plugins/cpu/multicpu1sec-c.c @@ -122,7 +122,7 @@ int acquire() { /* open the spoolfile */ FILE* cache_file = fopen(cache_filename, "a"); if (!cache_file) { - return acquire(); + return fail("cannot create cache_file"); } int cache_file_fd = fileno(cache_file);