diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2017-02-25 02:17:18 +0100 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2017-03-02 12:22:40 +0100 |
commit | 3e315cd17a519dbcafff18d4294a6f7bb8070767 (patch) | |
tree | e8950e052bb5ee4328a052a9cf04efc847c47eff /nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | |
parent | 9d41e84ea9baf215c6de11224dc2597cd37359dc (diff) | |
download | nx-libs-3e315cd17a519dbcafff18d4294a6f7bb8070767.tar.gz nx-libs-3e315cd17a519dbcafff18d4294a6f7bb8070767.tar.bz2 nx-libs-3e315cd17a519dbcafff18d4294a6f7bb8070767.zip |
Fix "uninitialised byte(s)" complaints from valgrind
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXpicture.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 1188d06bf..53a4633e5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -95,10 +95,9 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) nxagentPictureCreateDefaultFormats(pScreen, formats, &nformats); - pFormats = (PictFormatPtr) malloc (nformats * sizeof (PictFormatRec)); + pFormats = (PictFormatPtr) calloc (nformats, sizeof (PictFormatRec)); if (!pFormats) return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); for (f = 0; f < nformats; f++) { pFormats[f].id = FakeClientID (0); @@ -198,7 +197,7 @@ AllocatePicture (ScreenPtr pScreen) unsigned int size; int i; - pPicture = (PicturePtr) malloc (ps->totalPictureSize); + pPicture = (PicturePtr) calloc(1, ps->totalPictureSize); if (!pPicture) return 0; ppriv = (DevUnion *)(pPicture + 1); @@ -289,7 +288,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); + pPicture->pSourcePict = (SourcePictPtr) calloc(1, sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -326,7 +325,7 @@ static PicturePtr createSourcePicture(void) picturePrivateCount * sizeof(DevUnion) + sizeof(nxagentPrivPictureRec); - pPicture = (PicturePtr) malloc(totalPictureSize); + pPicture = (PicturePtr) calloc(1, totalPictureSize); if (pPicture != NULL) { |