mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
one more error handling fix for GetTimeFormatA()
svn path=/trunk/; revision=9093
This commit is contained in:
parent
a46eec6cea
commit
bdc459faa9
1 changed files with 27 additions and 30 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: lang.c,v 1.13 2004/04/12 10:19:43 mf Exp $
|
||||
/* $Id: lang.c,v 1.14 2004/04/12 10:49:48 mf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT : ReactOS user mode libraries
|
||||
|
@ -1320,7 +1320,7 @@ GetTimeFormatA (
|
|||
LPWSTR lpFormatU = NULL;
|
||||
LPWSTR lpTimeStrU;
|
||||
int numCharsU;
|
||||
int retVal;
|
||||
int retVal = 0;
|
||||
|
||||
if (lpFormat != NULL) {
|
||||
/* First just determine the number of necessary bytes
|
||||
|
@ -1352,12 +1352,7 @@ GetTimeFormatA (
|
|||
Unicode output */
|
||||
numCharsU = GetTimeFormatW(Locale,dwFlags,lpTime,lpFormatU,NULL,0);
|
||||
|
||||
if (numCharsU == 0) {
|
||||
if (lpFormatU != NULL)
|
||||
HeapFree(GetProcessHeap(),0,lpFormatU);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (numCharsU != 0) {
|
||||
lpTimeStrU = HeapAlloc(GetProcessHeap(),0,numCharsU*sizeof(WCHAR));
|
||||
if (lpTimeStrU == NULL) {
|
||||
if (lpFormatU != NULL)
|
||||
|
@ -1377,6 +1372,8 @@ GetTimeFormatA (
|
|||
NULL);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,lpTimeStrU);
|
||||
}
|
||||
|
||||
if (lpFormatU != NULL)
|
||||
HeapFree(GetProcessHeap(),0,lpFormatU);
|
||||
|
||||
|
|
Loading…
Reference in a new issue