From: Michal Privoznik Date: Thu, 22 Oct 2020 10:49:44 +0000 (+0200) Subject: parthelper: Initialize error object X-Git-Tag: v6.9.0-rc1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b8deb9603fb2a393a28fe4750aba91626619305;p=thirdparty%2Flibvirt.git parthelper: Initialize error object Some functions called from parthelper can report an error. But that means that the error object must be initialized otherwise virResetError() (which happens as a part of virReportError()) will free random pointers. Reported-by: Katerina Koukiou Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c index 812e90d3cb..29a01d3dd5 100644 --- a/src/storage/parthelper.c +++ b/src/storage/parthelper.c @@ -66,7 +66,8 @@ int main(int argc, char **argv) const char *partsep; bool devmap_partsep = false; - if (virGettextInitialize() < 0) + if (virGettextInitialize() < 0 || + virErrorInitialize() < 0) exit(EXIT_FAILURE); if (argc == 3 && STREQ(argv[2], "-g")) {