gnucash maint: AQB Flicker: Replace malloc with g_malloc0.
John Ralls
jralls at code.gnucash.org
Sun Dec 13 16:53:42 EST 2020
Updated via https://github.com/Gnucash/gnucash/commit/2c8ae267 (commit)
from https://github.com/Gnucash/gnucash/commit/14a53032 (commit)
commit 2c8ae267f9b7eda4847cfba3d2b260ce8186fc6f
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Dec 13 13:49:24 2020 -0800
AQB Flicker: Replace malloc with g_malloc0.
Windows doesn't know about malloc.
diff --git a/gnucash/import-export/aqb/gnc-flicker-gui.c b/gnucash/import-export/aqb/gnc-flicker-gui.c
index f0d78e88b..fdcbc47a1 100644
--- a/gnucash/import-export/aqb/gnc-flicker-gui.c
+++ b/gnucash/import-export/aqb/gnc-flicker-gui.c
@@ -131,7 +131,7 @@ static char
/* prepend synchronization identifier */
const char pre[] = {'0', 'F', 'F', 'F'};
size_t len = sizeof (pre) + strlen (challenge) + 1;
- char* code = (char*)malloc (len);
+ char* code = (char*)g_malloc0 (len);
memcpy (code, pre, sizeof (pre));
memcpy (code + sizeof (pre), challenge, strlen (challenge));
@@ -306,7 +306,7 @@ do_flicker_store_state (GtkWidget *dialog)
static void
on_flicker_challenge_map (GtkWidget *widget)
{
- gchar *code = g_malloc (strlen (flickerdraw.challenge) + 4);
+ gchar *code = g_malloc0 (strlen (flickerdraw.challenge) + 4);
code = flicker_data (flickerdraw.challenge);
flickerdraw.challenge_length = strlen (code);
Summary of changes:
gnucash/import-export/aqb/gnc-flicker-gui.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list