From 38c10c85cbfbc47eaaf64a58fb50d60e136af673 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 11 Jun 2017 10:12:50 +0100 Subject: Windows: Ensure core windows are fully initialised. --- frontends/windows/cookies.c | 2 +- frontends/windows/global_history.c | 2 +- frontends/windows/hotlist.c | 2 +- frontends/windows/local_history.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'frontends/windows') diff --git a/frontends/windows/cookies.c b/frontends/windows/cookies.c index c4880fa1c..b3c56da8c 100644 --- a/frontends/windows/cookies.c +++ b/frontends/windows/cookies.c @@ -136,7 +136,7 @@ static nserror nsw32_cookie_init(HINSTANCE hInstance) return NSERROR_OK; } - ncwin = malloc(sizeof(struct nsw32_cookie_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; } diff --git a/frontends/windows/global_history.c b/frontends/windows/global_history.c index 0ba013bf0..dcc75ba21 100644 --- a/frontends/windows/global_history.c +++ b/frontends/windows/global_history.c @@ -126,7 +126,7 @@ static nserror nsw32_global_history_init(HINSTANCE hInstance) return NSERROR_OK; } - ncwin = malloc(sizeof(struct nsw32_global_history_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; } diff --git a/frontends/windows/hotlist.c b/frontends/windows/hotlist.c index 0efe76f79..e8dd90b34 100644 --- a/frontends/windows/hotlist.c +++ b/frontends/windows/hotlist.c @@ -130,7 +130,7 @@ static nserror nsw32_hotlist_init(HINSTANCE hInstance) return NSERROR_OK; } - ncwin = malloc(sizeof(struct nsw32_hotlist_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; } diff --git a/frontends/windows/local_history.c b/frontends/windows/local_history.c index 205ebfe94..722d365e7 100644 --- a/frontends/windows/local_history.c +++ b/frontends/windows/local_history.c @@ -143,7 +143,7 @@ nsw32_local_history_init(HINSTANCE hInstance, return res; } - ncwin = malloc(sizeof(struct nsw32_local_history_window)); + ncwin = calloc(1, sizeof(*ncwin)); if (ncwin == NULL) { return NSERROR_NOMEM; } -- cgit v1.2.3