diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-03-03 11:04:10 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-03-03 11:04:10 +0100 |
commit | 20029dbc8f7d03211ceaf00001418fb75b9df644 (patch) | |
tree | e8950e052bb5ee4328a052a9cf04efc847c47eff /nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | |
parent | 9d41e84ea9baf215c6de11224dc2597cd37359dc (diff) | |
parent | 3e315cd17a519dbcafff18d4294a6f7bb8070767 (diff) | |
download | nx-libs-20029dbc8f7d03211ceaf00001418fb75b9df644.tar.gz nx-libs-20029dbc8f7d03211ceaf00001418fb75b9df644.tar.bz2 nx-libs-20029dbc8f7d03211ceaf00001418fb75b9df644.zip |
Merge branch 'uli42-pr/happyvalgrind' into 3.6.x
Fixes ArcticaProject/nx-libs#325.
Fixes ArcticaProject/nx-libs#326.
Attribute GH PR #360: https://github.com/ArcticaProject/nx-libs/pull/360
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) { |