commit cba315654e43edf66ba53d4fe1012a47ae0d27b8
parent 062994697d10f0fe26525885aa80228b69ef46ff
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 3 Sep 2012 13:43:10 +0000
check for malloc failure
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/plugins/ps_extractor.c b/src/plugins/ps_extractor.c
@@ -170,7 +170,8 @@ EXTRACTOR_ps_extract_method (struct EXTRACTOR_ExtractContext *ec)
while ( (NULL != next) &&
(0 == strncmp (next, "%%+", strlen ("%%+"))) )
{
- acc = malloc (strlen (line) + strlen (next) - 1);
+ if (NULL == (acc = malloc (strlen (line) + strlen (next) - 1)))
+ break;
strcpy (acc, line);
strcat (acc, " ");
strcat (acc, next + 3);