diff options
| author | Olivier Fourdan <ofourdan@redhat.com> | 2021-04-19 14:52:38 +0200 | 
|---|---|---|
| committer | Olivier Fourdan <ofourdan@redhat.com> | 2021-05-11 14:08:58 +0200 | 
| commit | a45799971083c47082d085d3732a5b12692cf75b (patch) | |
| tree | cf395994161a8959d306d86620e8f4df7406e865 /hw | |
| parent | 098e0f52c088c6eb52c7e54c5a11cefabd480908 (diff) | |
xwayland/eglstream: Fix calloc/malloc
Use calloc() instead of malloc() like the rest of the code.
Also fix the arguments of calloc() calls to match the definition which
is calloc(size_t nmemb, size_t size).
This is a cleanup patch, no functional change.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/xwayland/xwayland-glamor-eglstream.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xwayland/xwayland-glamor-eglstream.c b/hw/xwayland/xwayland-glamor-eglstream.c index ce066cd9e..3a3caa976 100644 --- a/hw/xwayland/xwayland-glamor-eglstream.c +++ b/hw/xwayland/xwayland-glamor-eglstream.c @@ -562,7 +562,7 @@ xwl_eglstream_queue_pending_stream(WindowPtr window, PixmapPtr pixmap)      DebugF("eglstream: win %d queues new pending stream for pixmap %p\n",             window->drawable.id, pixmap); -    pending_stream = malloc(sizeof(*pending_stream)); +    pending_stream = calloc(1, sizeof(*pending_stream));      pending_stream->window = window;      pending_stream->pixmap = pixmap;      pending_stream->is_valid = TRUE; @@ -596,7 +596,7 @@ xwl_eglstream_create_pixmap_and_stream(struct xwl_screen *xwl_screen,      struct wl_array stream_attribs;      int stream_fd = -1; -    xwl_pixmap = calloc(sizeof(*xwl_pixmap), 1); +    xwl_pixmap = calloc(1, sizeof(*xwl_pixmap));      if (!xwl_pixmap)          FatalError("Not enough memory to create pixmap\n");      xwl_pixmap_set_private(pixmap, xwl_pixmap);  | 
