From ccc42ba4f8e1e87f949b055c77d875be450aff48 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 8 Jan 2020 10:08:05 +0100 Subject: badwolf.c: g_malloc → malloc+perror+exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badwolf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/badwolf.c b/badwolf.c index d46c91c..74f6a7f 100644 --- a/badwolf.c +++ b/badwolf.c @@ -11,7 +11,7 @@ #include /* _() and other internationalization/localization helpers */ #include /* soup* */ #include /* LC_* */ -#include /* fprintf() */ +#include /* perror(), fprintf() */ #include /* malloc() */ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; @@ -745,7 +745,12 @@ int main(int argc, char *argv[]) { // getting an abort if this one fails to alloc - struct Window *window = g_malloc(sizeof(struct Window)); + struct Window *window = malloc(sizeof(struct Window)); + if(window == NULL) + { + perror("malloc"); + return 1; + } setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); -- cgit v1.3.1-23-gd82d