From 98a73379fec8297c840f592db8c9d2b6aed257bc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 11 Jun 2017 10:10:25 +0100 Subject: [PATCH] RISC OS: Ensure core windows are fully initialised. --- frontends/riscos/cookies.c | 2 +- frontends/riscos/global_history.c | 2 +- frontends/riscos/hotlist.c | 2 +- frontends/riscos/local_history.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontends/riscos/cookies.c b/frontends/riscos/cookies.c index 38963ab3a..614bc3d10 100644 --- a/frontends/riscos/cookies.c +++ b/frontends/riscos/cookies.c @@ -377,7 +377,7 @@ static nserror ro_cookie_init(void) return NSERROR_OK; } - ncwin = malloc(sizeof(struct ro_cookie_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; } diff --git a/frontends/riscos/global_history.c b/frontends/riscos/global_history.c index 94e1d4a03..d122a4d7f 100644 --- a/frontends/riscos/global_history.c +++ b/frontends/riscos/global_history.c @@ -405,7 +405,7 @@ static nserror ro_global_history_init(void) return NSERROR_OK; } - ncwin = malloc(sizeof(struct ro_global_history_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; } diff --git a/frontends/riscos/hotlist.c b/frontends/riscos/hotlist.c index d3480093e..b055d1bec 100644 --- a/frontends/riscos/hotlist.c +++ b/frontends/riscos/hotlist.c @@ -466,7 +466,7 @@ static nserror ro_hotlist_init(void) return NSERROR_OK; } - ncwin = malloc(sizeof(struct ro_hotlist_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; } diff --git a/frontends/riscos/local_history.c b/frontends/riscos/local_history.c index 1ae98ff9a..f9f1f2e01 100644 --- a/frontends/riscos/local_history.c +++ b/frontends/riscos/local_history.c @@ -299,7 +299,7 @@ ro_local_history_init(struct browser_window *bw, return res; } - ncwin = malloc(sizeof(struct ro_local_history_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; }