Hi!
[ Upstream commit 208baa3ec9043a664d9acfb8174b332e6b17fb69 ]
If malloc returns NULL due to low memory, 'config' pointer can be NULL. Add a check to prevent NULL dereference.
This fixes nothing. We have oom killer, so we don't have malloc returning NULL.
Best regards, Pavel
+++ b/tools/power/cpupower/bench/parse.c @@ -120,6 +120,10 @@ FILE *prepare_output(const char *dirname) struct config *prepare_default_config() { struct config *config = malloc(sizeof(struct config));
- if (!config) {
perror("malloc");
return NULL;
- }
dprintf("loading defaults\n");