trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #957: TRAFODION-2441 user has only select p...
Date Tue, 14 Feb 2017 23:23:26 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/957#discussion_r101165083
  
    --- Diff: core/sql/common/ComUser.cpp ---
    @@ -348,6 +348,33 @@ Int16 ComUser::getAuthNameFromAuthID(Int32   authID,
       return FEOK;
     }
     
    +
    +// ----------------------------------------------------------------------------
    +// method: currentUserHasRole
    +//
    +// Searches the list of roles stored for the user to see if passed in role ID
    +// is found
    +//
    +//  Returns:  true - role found
    +//            false - role not found
    +// ----------------------------------------------------------------------------
    +bool ComUser::currentUserHasRole(Int32 roleID)
    +{
    +  Int32 numRoles = 0;
    +  Int32 *roleIDs = 0;
    +  if (SQL_EXEC_GetRoleList(numRoles, roleIDs) < 0)
    --- End diff --
    
    How does this work? Does SQL_EXEC_GetRoleList allocate an array and expect the caller
to deallocate it? (If so, there's a memory leak here.) Or is the array in the CLI's own data
space? (If so, is there any concern about exposing pointers to CLI data structures to the
caller's code?)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message