nullptr initialization in security_registration 84/45884/2
authorAnna Niznik <a.niznik@samsung.com>
Tue, 7 Jul 2015 14:05:11 +0000 (16:05 +0200)
committerPawel Sikorski <p.sikorski@samsung.com>
Wed, 12 Aug 2015 13:21:30 +0000 (06:21 -0700)
The pointer was not initialized, so it had random value.

Change-Id: I57e2fa2c176ff208682e5f41bf135c6c25ff4dde

src/common/security_registration.cc

index a00463f..054b1bd 100644 (file)
@@ -45,7 +45,7 @@ bool PrepareRequest(const std::string& app_id, const std::string& pkg_id,
     privileges_x *privileges = nullptr;
     PKGMGR_LIST_MOVE_NODE_TO_HEAD(manifest->privileges, privileges);
     for (; privileges != nullptr; privileges = privileges->next) {
-      privilege_x* priv;
+      privilege_x* priv = nullptr;
       PKGMGR_LIST_MOVE_NODE_TO_HEAD(privileges->privilege, priv);
       for (; priv != nullptr; priv = priv->next) {
         security_manager_app_inst_req_add_privilege(req, priv->text);