setupapi: Correctly report errors in fake_dlls_callback (Coverity)
Frédéric Delanoy
frederic.delanoy at gmail.com
Tue Jan 17 18:41:44 CST 2012
'ret'urn value was initially set to TRUE and never updated.
CID 1492
---
dlls/setupapi/install.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/setupapi/install.c b/dlls/setupapi/install.c
index 947a512..d181969 100644
--- a/dlls/setupapi/install.c
+++ b/dlls/setupapi/install.c
@@ -713,10 +713,14 @@ static BOOL fake_dlls_callback( HINF hinf, PCWSTR field, void *arg )
if (!(path = PARSER_get_dest_dir( &context ))) continue;
/* get dll name */
- if (!SetupGetStringFieldW( &context, 3, buffer, sizeof(buffer)/sizeof(WCHAR), NULL ))
+ if (!(ret = SetupGetStringFieldW( &context, 3, buffer, sizeof(buffer)/sizeof(WCHAR), NULL )))
goto done;
if (!(p = HeapReAlloc( GetProcessHeap(), 0, path,
- (strlenW(path) + strlenW(buffer) + 2) * sizeof(WCHAR) ))) goto done;
+ (strlenW(path) + strlenW(buffer) + 2) * sizeof(WCHAR) )))
+ {
+ ret = FALSE;
+ goto done;
+ }
path = p;
p += strlenW(p);
if (p == path || p[-1] != '\\') *p++ = '\\';
--
1.7.8.3
More information about the wine-patches
mailing list