Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitccc42ba4f8e1e87f949b055c77d875be450aff48 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2020-01-08 10:08:05 +0100
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2020-01-08 10:09:03 +0100
Files3ca102286a81ebef46c77184c314c1fdae1fae2d
goodwolf-ccc42ba4f8e1e87f949b055c77d875be450aff48.tar
goodwolf-ccc42ba4f8e1e87f949b055c77d875be450aff48.tar.gz
goodwolf-ccc42ba4f8e1e87f949b055c77d875be450aff48.zip
Parente97228fc74b15026f2c8db56c069ffed11898d4d (diff)
badwolf.c: g_malloc → malloc+perror+exit
1 files changed, 7 insertions, 2 deletions
-rw-r--r--badwolf.c9
diff --git a/badwolf.c b/badwolf.c
index d46c91c..74f6a7f 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -11,7 +11,7 @@
#include <glib/gi18n.h> /* _() and other internationalization/localization helpers */
#include <libsoup/soup.h> /* soup* */
#include <locale.h> /* LC_* */
-#include <stdio.h> /* fprintf() */
+#include <stdio.h> /* perror(), fprintf() */
#include <stdlib.h> /* 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");