[PATCH libICE 1/3] Make sure errorStr is a free-able string

Eric Engestrom eric.engestrom at imgtec.com
Fri Jul 7 10:23:46 UTC 2017


If the `errorClass` isn't handled by the switch, `errorStr`'s initial
value would be a pointer to some static memory with an empty string,
and freeing it would most likely crash.

Let's set it to NULL instead, as is done in other similar places.

Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 src/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/process.c b/src/process.c
index 4100a83..1d7c07a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -715,7 +715,7 @@ ProcessError (
 	{
 	    _IceProtocolError *errorReply =
 	        &(((_IceReply *) (replyWait->reply))->protocol_error);
-	    char *errorStr = "";
+	    char *errorStr = NULL;
 	    const char *prefix;
 	    char *temp;
 
-- 
Cheers,
  Eric



More information about the xorg-devel mailing list