Fix gcc-11 compiler warning on makedumpfile.c

Without the patch, the following gcc-11 compiler warning is emitted for
makedumpfile.c:

In function 'flattened_format_get_osrelease',
    inlined from 'check_flattened_format' at makedumpfile.c:236:3:
makedumpfile.c:392:9: warning: 'fclose' called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc]
  392 |         fclose(pipe);
      |         ^~~~~~~~~~~~
makedumpfile.c: In function 'check_flattened_format':
makedumpfile.c:380:21: note: returned from 'popen'
  380 |         if ((pipe = popen(buf, "r")) == NULL)
      |                     ^~~~~~~~~~~~~~~

Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
This commit is contained in:
Kazuhito Hagio 2022-07-22 13:44:50 +09:00
parent b9c0ed124e
commit 7591e3c07c

View File

@ -389,5 +389,5 @@ flattened_format_get_osrelease(char *file)
}
}
fclose(pipe);
pclose(pipe);
}