aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-07-03 16:41:02 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-07-03 16:41:02 +0200
commit5a8549c6edd0b18fa2315045622bca0f91853796 (patch)
tree4623aec4206d9338e5bcf16a2b71c8898632df80 /nx-X11/programs/Xserver/hw/nxagent
parentfd9de0086d10ee236dd24d51d93f60edf52cd89c (diff)
parent5651680bbde34de2713d06e868416145e269cb7c (diff)
downloadnx-libs-5a8549c6edd0b18fa2315045622bca0f91853796.tar.gz
nx-libs-5a8549c6edd0b18fa2315045622bca0f91853796.tar.bz2
nx-libs-5a8549c6edd0b18fa2315045622bca0f91853796.zip
Merge branch 'mjtrangoni-WIP-add-cppcheck' into 3.6.x
Attributes GH PR #678: https://github.com/ArcticaProject/nx-libs/pull/678
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c1
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/compext/Png.c13
3 files changed, 13 insertions, 7 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c
index 04f746aaf..a51ae6fcc 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c
@@ -629,11 +629,13 @@ int what;
screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0,
(XID *)NULL, &status);
if (!screenContext[i])
+ free(prect);
return;
numGCs++;
if (!AddResource(FakeClientID(0), ResType,
- (void *)screenContext[i]))
- return;
+ (void *)screenContext[i]))
+ free(prect);
+ return;
}
pGC = screenContext[i];
newValues[SUBWINDOW].val = IncludeInferiors;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index 691b260cf..8937e2e7d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
@@ -995,6 +995,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
{
listsBase = (GlyphListPtr) malloc (nlist * sizeof (GlyphListRec));
if (!listsBase)
+ free(glyphsBase);
return BadAlloc;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c
index 457080032..91412baa1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c
@@ -283,6 +283,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
bitsPerPixel);
#endif
+ free(image_index);
return NULL;
}
@@ -315,6 +316,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
fprintf(stderr, "******PngCompressData: PANIC! Failed creating the png_create_write_struct.\n");
#endif
+ free(image_index);
return NULL;
}
@@ -327,7 +329,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif
png_destroy_write_struct(&png_ptr, NULL);
-
+ free(image_index);
return NULL;
}
@@ -339,6 +341,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct(&png_ptr, &info_ptr);
+ free(image_index);
return NULL;
}
@@ -360,6 +363,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
PNG_DEST_SIZE(w, h));
#endif
+ free(image_index);
return NULL;
}
@@ -374,7 +378,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct(&png_ptr, &info_ptr);
free(pngCompBuf);
-
return NULL;
}
@@ -470,7 +473,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
png_destroy_write_struct(&png_ptr, &info_ptr);
free(pngCompBuf);
-
+ free(image_index);
return NULL;
}
@@ -484,7 +487,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
fprintf(stderr, "******PngCompressData: PANIC! Cannot allocate [%d] bytes.\n",
(int) (w * sizeof(CARD8)));
#endif
-
+ free(image_index);
return NULL;
}
@@ -516,7 +519,7 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif
free(pngCompBuf);
-
+ free(image_index);
return NULL;
}