Commit f05618bd authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Do not HeapFree() memory not allocated by us in COMBO_GetText.

Convert return value from LB_GETTEXT into COMBO_GetText.
parent 3ee02bab
......@@ -1498,6 +1498,9 @@ static LRESULT COMBO_ItemOp( LPHEADCOMBO lphc, UINT msg, LPARAM lParam )
/***********************************************************************
* COMBO_GetText
*
* NOTE! LB_GETTEXT does not count terminating \0, WM_GETTEXT does.
* also LB_GETTEXT might return values < 0, WM_GETTEXT doesn't.
*/
static LRESULT COMBO_GetText( LPHEADCOMBO lphc, INT N, LPARAM lParam, BOOL unicode)
{
......@@ -1539,10 +1542,10 @@ static LRESULT COMBO_GetText( LPHEADCOMBO lphc, INT N, LPARAM lParam, BOOL unico
strncpyW(lpText, lpBuffer, (N > n) ? n+1 : N-1);
lpText[N - 1] = '\0';
}
}
HeapFree( GetProcessHeap(), 0, lpBuffer );
}
}
}
else
{
LPSTR lpBuffer, lpText = (LPSTR)lParam;
......@@ -1566,10 +1569,14 @@ static LRESULT COMBO_GetText( LPHEADCOMBO lphc, INT N, LPARAM lParam, BOOL unico
strncpy(lpText, lpBuffer, (N > n) ? n+1 : N-1);
lpText[N - 1] = '\0';
}
}
HeapFree( GetProcessHeap(), 0, lpBuffer );
}
}
}
if (n<0)
n=0;
else
n++;
return (LRESULT)n;
}
}
......
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