xcursor: Fix allocation based on string length

strlen() doesn't include the terminating NUL. Therefore when allocating a
block of memory to hold something equivalent to the length of the string we
must increment to take the NUL byte into consideration.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
This commit is contained in:
Rob Bradford 2012-10-09 18:46:21 +01:00 committed by Kristian Høgsberg
parent b41dc10063
commit 0201708773

View file

@ -757,7 +757,7 @@ _XcursorThemeInherits (const char *full)
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
result = malloc (strlen (l));
result = malloc (strlen (l) + 1);
if (result)
{
r = result;