Kaydet (Commit) 5d483a67 authored tarafından Miklos Vajna's avatar Miklos Vajna

lokdocview: fix memory leak in lcl_payloadToRectangle()

Change-Id: I2894c693d11b025d23ebbf0ae75f67532efe315f
üst 4b707104
......@@ -330,24 +330,27 @@ static GdkRectangle lcl_payloadToRectangle(const char* pPayload)
{
GdkRectangle aRet;
gchar** ppCoordinates;
gchar** ppCoordinate;
aRet.width = aRet.height = aRet.x = aRet.y = 0;
ppCoordinates = g_strsplit(pPayload, ", ", 4);
if (!*ppCoordinates)
ppCoordinate = ppCoordinates;
if (!*ppCoordinate)
return aRet;
aRet.width = atoi(*ppCoordinates);
++ppCoordinates;
if (!*ppCoordinates)
aRet.width = atoi(*ppCoordinate);
++ppCoordinate;
if (!*ppCoordinate)
return aRet;
aRet.height = atoi(*ppCoordinates);
++ppCoordinates;
if (!*ppCoordinates)
aRet.height = atoi(*ppCoordinate);
++ppCoordinate;
if (!*ppCoordinate)
return aRet;
aRet.x = atoi(*ppCoordinates);
++ppCoordinates;
if (!*ppCoordinates)
aRet.x = atoi(*ppCoordinate);
++ppCoordinate;
if (!*ppCoordinate)
return aRet;
aRet.y = atoi(*ppCoordinates);
aRet.y = atoi(*ppCoordinate);
g_strfreev(ppCoordinates);
return aRet;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment