From c44f6ffc3c657be468ce2451d27638451fc9e5df Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 12 Apr 2017 11:37:34 -0400 Subject: [PATCH] n-api: fix coverity scan report Coverity was reporting _request.work_req as not being initialized. Add memset to ensure all of _request is initialized. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12365 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- src/node_api.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_api.cc b/src/node_api.cc index 880c2d26f7480d..76cc4e9d80f7a6 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -2666,6 +2666,7 @@ class Work { _data(data), _execute(execute), _complete(complete) { + memset(&_request, 0, sizeof(_request)); _request.data = this; }