Blame SOURCES/0017-xwayland-eglstream-Fix-calloc-malloc.patch

5f5628
From 39df6934d5a9a132c2e87456e35094b7e81a238e Mon Sep 17 00:00:00 2001
5f5628
From: Olivier Fourdan <ofourdan@redhat.com>
5f5628
Date: Mon, 19 Apr 2021 14:52:38 +0200
5f5628
Subject: [PATCH xserver 17/27] xwayland/eglstream: Fix calloc/malloc
5f5628
MIME-Version: 1.0
5f5628
Content-Type: text/plain; charset=UTF-8
5f5628
Content-Transfer-Encoding: 8bit
5f5628
5f5628
Use calloc() instead of malloc() like the rest of the code.
5f5628
5f5628
Also fix the arguments of calloc() calls to match the definition which
5f5628
is calloc(size_t nmemb, size_t size).
5f5628
5f5628
This is a cleanup patch, no functional change.
5f5628
5f5628
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
5f5628
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
5f5628
(cherry picked from commit a45799971083c47082d085d3732a5b12692cf75b)
5f5628
---
5f5628
 hw/xwayland/xwayland-glamor-eglstream.c | 4 ++--
5f5628
 1 file changed, 2 insertions(+), 2 deletions(-)
5f5628
5f5628
diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c
5f5628
index ce066cd9e..3a3caa976 100644
5f5628
--- a/hw/xwayland/xwayland-glamor-eglstream.c
5f5628
+++ b/hw/xwayland/xwayland-glamor-eglstream.c
5f5628
@@ -562,7 +562,7 @@ xwl_eglstream_queue_pending_stream(WindowPtr window, PixmapPtr pixmap)
5f5628
     DebugF("eglstream: win %d queues new pending stream for pixmap %p\n",
5f5628
            window->drawable.id, pixmap);
5f5628
 
5f5628
-    pending_stream = malloc(sizeof(*pending_stream));
5f5628
+    pending_stream = calloc(1, sizeof(*pending_stream));
5f5628
     pending_stream->window = window;
5f5628
     pending_stream->pixmap = pixmap;
5f5628
     pending_stream->is_valid = TRUE;
5f5628
@@ -596,7 +596,7 @@ xwl_eglstream_create_pixmap_and_stream(struct xwl_screen *xwl_screen,
5f5628
     struct wl_array stream_attribs;
5f5628
     int stream_fd = -1;
5f5628
 
5f5628
-    xwl_pixmap = calloc(sizeof(*xwl_pixmap), 1);
5f5628
+    xwl_pixmap = calloc(1, sizeof(*xwl_pixmap));
5f5628
     if (!xwl_pixmap)
5f5628
         FatalError("Not enough memory to create pixmap\n");
5f5628
     xwl_pixmap_set_private(pixmap, xwl_pixmap);
5f5628
-- 
5f5628
2.31.1
5f5628