mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1060115 - Avoid using malloc/free in b2g.exe on b2g desktop so that we can make it work on XPSP2 with MSVC2013; r=dmajor
This commit is contained in:
parent
9fcca9b22a
commit
d63d4121d6
@ -283,15 +283,17 @@ int main(int argc, _CONST char* argv[])
|
||||
*/
|
||||
_argv = new char *[argc + 1];
|
||||
for (int i = 0; i < argc; i++) {
|
||||
_argv[i] = strdup(argv[i]);
|
||||
size_t len = strlen(argv[i]) + 1;
|
||||
_argv[i] = new char[len];
|
||||
MOZ_ASSERT(_argv[i] != nullptr);
|
||||
memcpy(_argv[i], argv[i], len);
|
||||
}
|
||||
_argv[argc] = nullptr;
|
||||
|
||||
result = do_main(argc, _argv);
|
||||
|
||||
for (int i = 0; i < argc; i++) {
|
||||
free(_argv[i]);
|
||||
delete[] _argv[i];
|
||||
}
|
||||
delete[] _argv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user