Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cb18dbf9
Commit
cb18dbf9
authored
Apr 24, 2000
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Apr 24, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the last xmalloc calls.
parent
e1e75371
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
63 deletions
+16
-63
install.c
dlls/version/install.c
+15
-8
bitmap.c
graphics/x11drv/bitmap.c
+0
-1
xmalloc.h
include/xmalloc.h
+0
-19
Makefile.in
misc/Makefile.in
+1
-2
xmalloc.c
misc/xmalloc.c
+0
-33
No files found.
dlls/version/install.c
View file @
cb18dbf9
...
...
@@ -15,7 +15,6 @@
#include "winerror.h"
#include "heap.h"
#include "lzexpand.h"
#include "xmalloc.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
ver
);
...
...
@@ -355,17 +354,25 @@ _fetch_versioninfo(LPSTR fn,VS_FIXEDFILEINFO **vffi) {
DWORD
ret
;
alloclen
=
1000
;
buf
=
xmalloc
(
alloclen
);
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
alloclen
);
if
(
buf
==
NULL
)
{
WARN
(
"Memory exausted while fetching version info!"
);
return
NULL
;
}
while
(
1
)
{
ret
=
GetFileVersionInfoA
(
fn
,
0
,
alloclen
,
buf
);
if
(
!
ret
)
{
free
(
buf
);
return
0
;
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
NULL
;
}
if
(
alloclen
<*
(
WORD
*
)
buf
)
{
free
(
buf
);
alloclen
=
*
(
WORD
*
)
buf
;
buf
=
xmalloc
(
alloclen
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
alloclen
);
if
(
buf
==
NULL
)
{
WARN
(
"Memory exausted while fetching version info!"
);
return
NULL
;
}
}
else
{
*
vffi
=
(
VS_FIXEDFILEINFO
*
)(
buf
+
0x14
);
if
((
*
vffi
)
->
dwSignature
==
0x004f0049
)
/* hack to detect unicode */
...
...
@@ -510,10 +517,10 @@ DWORD WINAPI VerInstallFileA(
* generiert DIFFLANG|MISMATCH
*/
}
free
(
buf2
);
HeapFree
(
GetProcessHeap
(),
0
,
buf2
);
}
else
xret
=
VIF_MISMATCH
|
VIF_SRCOLD
;
free
(
buf1
);
HeapFree
(
GetProcessHeap
(),
0
,
buf1
);
}
}
if
(
xret
)
{
...
...
graphics/x11drv/bitmap.c
View file @
cb18dbf9
...
...
@@ -20,7 +20,6 @@
#include "bitmap.h"
#include "heap.h"
#include "debugtools.h"
#include "xmalloc.h"
#include "local.h"
#include "x11drv.h"
#include "wingdi.h"
...
...
include/xmalloc.h
deleted
100644 → 0
View file @
e1e75371
#ifndef __WINE_XMALLOC_H
#define __WINE_XMALLOC_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include <sys/types.h>
void
*
xmalloc
(
size_t
size
);
void
*
xcalloc
(
size_t
size
);
void
*
xrealloc
(
void
*
ptr
,
size_t
size
);
char
*
xstrdup
(
const
char
*
str
);
#ifdef __cplusplus
}
#endif
#endif
/* __WINE_XMALLOC_H */
misc/Makefile.in
View file @
cb18dbf9
...
...
@@ -26,8 +26,7 @@ C_SRCS = \
tweak.c
\
version.c
\
w32scomb.c
\
wsprintf.c
\
xmalloc.c
wsprintf.c
GLUE
=
printdrv.c
...
...
misc/xmalloc.c
deleted
100644 → 0
View file @
e1e75371
/*
xmalloc - a safe malloc
Use this function instead of malloc whenever you don't intend to check
the return value yourself, for instance because you don't have a good
way to handle a zero return value.
Typically, Wine's own memory requests should be handled by this function,
while the clients should use malloc directly (and Wine should return an
error to the client if allocation fails).
Copyright 1995 by Morten Welinder.
*/
#include <stdlib.h>
#include <string.h>
#include "xmalloc.h"
#include "debugtools.h"
void
*
xmalloc
(
size_t
size
)
{
void
*
res
;
res
=
malloc
(
size
?
size
:
1
);
if
(
res
==
NULL
)
{
MESSAGE
(
"Virtual memory exhausted.
\n
"
);
exit
(
1
);
}
memset
(
res
,
0
,
size
);
return
res
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment