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
5013c4d9
Commit
5013c4d9
authored
Dec 01, 2009
by
Marcus Meissner
Committed by
Alexandre Julliard
Dec 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Check for NULL return from allocations.
parent
8a06bd9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
txtrange.c
dlls/mshtml/txtrange.c
+9
-5
No files found.
dlls/mshtml/txtrange.c
View file @
5013c4d9
...
...
@@ -177,12 +177,14 @@ static BOOL is_space_elem(nsIDOMNode *node)
return
ret
;
}
static
inline
void
wstrbuf_init
(
wstrbuf_t
*
buf
)
static
inline
BOOL
wstrbuf_init
(
wstrbuf_t
*
buf
)
{
buf
->
len
=
0
;
buf
->
size
=
16
;
buf
->
buf
=
heap_alloc
(
buf
->
size
*
sizeof
(
WCHAR
));
if
(
!
buf
->
buf
)
return
FALSE
;
*
buf
->
buf
=
0
;
return
TRUE
;
}
static
inline
void
wstrbuf_finish
(
wstrbuf_t
*
buf
)
...
...
@@ -549,13 +551,14 @@ HRESULT get_node_text(HTMLDOMNode *node, BSTR *ret)
wstrbuf_t
buf
;
HRESULT
hres
=
S_OK
;
wstrbuf_init
(
&
buf
);
if
(
!
wstrbuf_init
(
&
buf
))
return
E_OUTOFMEMORY
;
wstrbuf_append_node_rec
(
&
buf
,
node
->
nsnode
);
if
(
buf
.
buf
)
{
*
ret
=
SysAllocString
(
buf
.
buf
);
if
(
!*
ret
)
hres
=
E_OUTOFMEMORY
;
}
else
{
}
else
{
*
ret
=
NULL
;
}
wstrbuf_finish
(
&
buf
);
...
...
@@ -1171,9 +1174,10 @@ static HRESULT WINAPI HTMLTxtRange_get_text(IHTMLTxtRange *iface, BSTR *p)
if
(
!
This
->
nsrange
)
return
S_OK
;
wstrbuf_init
(
&
buf
);
if
(
!
wstrbuf_init
(
&
buf
))
return
E_OUTOFMEMORY
;
range_to_string
(
This
,
&
buf
);
if
(
buf
.
buf
)
if
(
buf
.
buf
)
*
p
=
SysAllocString
(
buf
.
buf
);
wstrbuf_finish
(
&
buf
);
...
...
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