{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments/45372631","id":45372631,"diff_hunk":"@@ -1498,32 +1577,50 @@ PrivColumnBitmap colGrantableBitmap;\n       }\n       int32_t usedColNumber = naCol->getPosition();\n      \n-      // Grab privileges from the NATable structure\n-      PrivMgrUserPrivs *privs = naTable->getPrivInfo();\n-      if (privs == NULL) \n+      PrivMgrUserPrivs privs;\n+      PrivMgrUserPrivs *pPrivInfo = NULL;\n+      if (viewCreator)\n+        pPrivInfo = naTable->getPrivInfo();\n+      else\n+      {\n+        PrivStatus retcode = privInterface.getPrivileges((int64_t)naTable->objectUid().get_value(),\n+                                                           naTable->getObjectType(),\n+                                                           naTable->getOwner(),\n+                                                           privs);\n+\n+        if (retcode == STATUS_ERROR)\n+        {\n+           *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_RETRIEVE_PRIVS);\n+           return false;\n+        }\n+        pPrivInfo = &privs;","path":"core/sql/sqlcomp/CmpSeabaseDDLview.cpp","position":342,"original_position":342,"commit_id":"8f658efa21fea35336f8b814bb37d1f5c2bbf3da","original_commit_id":"8f658efa21fea35336f8b814bb37d1f5c2bbf3da","user":{"login":"DaveBirdsall","id":5659628,"avatar_url":"https://avatars.githubusercontent.com/u/5659628?v=3","gravatar_id":"","url":"https://api.github.com/users/DaveBirdsall","html_url":"https://github.com/DaveBirdsall","followers_url":"https://api.github.com/users/DaveBirdsall/followers","following_url":"https://api.github.com/users/DaveBirdsall/following{/other_user}","gists_url":"https://api.github.com/users/DaveBirdsall/gists{/gist_id}","starred_url":"https://api.github.com/users/DaveBirdsall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaveBirdsall/subscriptions","organizations_url":"https://api.github.com/users/DaveBirdsall/orgs","repos_url":"https://api.github.com/users/DaveBirdsall/repos","events_url":"https://api.github.com/users/DaveBirdsall/events{/privacy}","received_events_url":"https://api.github.com/users/DaveBirdsall/received_events","type":"User","site_admin":false},"body":"So, in one code path pPrivInfo points to a heap-allocated structure while in this code path it points to a stack variable. Is there any issue with memory leaks in the first case?","created_at":"2015-11-19T17:32:07Z","updated_at":"2015-11-19T17:32:07Z","html_url":"https://github.com/apache/incubator-trafodion/pull/182#discussion_r45372631","pull_request_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments/45372631"},"html":{"href":"https://github.com/apache/incubator-trafodion/pull/182#discussion_r45372631"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182","id":51169687,"html_url":"https://github.com/apache/incubator-trafodion/pull/182","diff_url":"https://github.com/apache/incubator-trafodion/pull/182.diff","patch_url":"https://github.com/apache/incubator-trafodion/pull/182.patch","issue_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/182","number":182,"state":"open","locked":false,"title":"[TRAFODION-1100] Creator of view in private schema unable to select from view","user":{"login":"robertamarton","id":13022496,"avatar_url":"https://avatars.githubusercontent.com/u/13022496?v=3","gravatar_id":"","url":"https://api.github.com/users/robertamarton","html_url":"https://github.com/robertamarton","followers_url":"https://api.github.com/users/robertamarton/followers","following_url":"https://api.github.com/users/robertamarton/following{/other_user}","gists_url":"https://api.github.com/users/robertamarton/gists{/gist_id}","starred_url":"https://api.github.com/users/robertamarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertamarton/subscriptions","organizations_url":"https://api.github.com/users/robertamarton/orgs","repos_url":"https://api.github.com/users/robertamarton/repos","events_url":"https://api.github.com/users/robertamarton/events{/privacy}","received_events_url":"https://api.github.com/users/robertamarton/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-11-19T01:47:49Z","updated_at":"2015-11-19T17:32:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfb4374c939efb23d40a1c5a0f2fa36de8a3934e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/182/comments","statuses_url":"https://api.github.com/repos/apache/incubator-trafodion/statuses/8f658efa21fea35336f8b814bb37d1f5c2bbf3da","head":{"label":"robertamarton:privs","ref":"privs","sha":"8f658efa21fea35336f8b814bb37d1f5c2bbf3da","user":{"login":"robertamarton","id":13022496,"avatar_url":"https://avatars.githubusercontent.com/u/13022496?v=3","gravatar_id":"","url":"https://api.github.com/users/robertamarton","html_url":"https://github.com/robertamarton","followers_url":"https://api.github.com/users/robertamarton/followers","following_url":"https://api.github.com/users/robertamarton/following{/other_user}","gists_url":"https://api.github.com/users/robertamarton/gists{/gist_id}","starred_url":"https://api.github.com/users/robertamarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertamarton/subscriptions","organizations_url":"https://api.github.com/users/robertamarton/orgs","repos_url":"https://api.github.com/users/robertamarton/repos","events_url":"https://api.github.com/users/robertamarton/events{/privacy}","received_events_url":"https://api.github.com/users/robertamarton/received_events","type":"User","site_admin":false},"repo":{"id":38080155,"name":"incubator-trafodion","full_name":"robertamarton/incubator-trafodion","owner":{"login":"robertamarton","id":13022496,"avatar_url":"https://avatars.githubusercontent.com/u/13022496?v=3","gravatar_id":"","url":"https://api.github.com/users/robertamarton","html_url":"https://github.com/robertamarton","followers_url":"https://api.github.com/users/robertamarton/followers","following_url":"https://api.github.com/users/robertamarton/following{/other_user}","gists_url":"https://api.github.com/users/robertamarton/gists{/gist_id}","starred_url":"https://api.github.com/users/robertamarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertamarton/subscriptions","organizations_url":"https://api.github.com/users/robertamarton/orgs","repos_url":"https://api.github.com/users/robertamarton/repos","events_url":"https://api.github.com/users/robertamarton/events{/privacy}","received_events_url":"https://api.github.com/users/robertamarton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robertamarton/incubator-trafodion","description":"Mirror of Apache Trafodion (Incubating)","fork":true,"url":"https://api.github.com/repos/robertamarton/incubator-trafodion","forks_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/forks","keys_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/teams","hooks_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/hooks","issue_events_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/issues/events{/number}","events_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/events","assignees_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/assignees{/user}","branches_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/branches{/branch}","tags_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/tags","blobs_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/git/refs{/sha}","trees_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/statuses/{sha}","languages_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/languages","stargazers_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/stargazers","contributors_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/contributors","subscribers_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/subscribers","subscription_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/subscription","commits_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/commits{/sha}","git_commits_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/git/commits{/sha}","comments_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/comments{/number}","issue_comment_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/issues/comments{/number}","contents_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/contents/{+path}","compare_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/merges","archive_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/downloads","issues_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/issues{/number}","pulls_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/pulls{/number}","milestones_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/milestones{/number}","notifications_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/labels{/name}","releases_url":"https://api.github.com/repos/robertamarton/incubator-trafodion/releases{/id}","created_at":"2015-06-25T23:40:10Z","updated_at":"2015-06-25T23:40:48Z","pushed_at":"2015-11-19T01:46:26Z","git_url":"git://github.com/robertamarton/incubator-trafodion.git","ssh_url":"git@github.com:robertamarton/incubator-trafodion.git","clone_url":"https://github.com/robertamarton/incubator-trafodion.git","svn_url":"https://github.com/robertamarton/incubator-trafodion","homepage":null,"size":57659,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"e54c7328b541dc45a6503e91a6981a4a066a3fc2","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":36349344,"name":"incubator-trafodion","full_name":"apache/incubator-trafodion","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-trafodion","description":"Mirror of Apache Trafodion (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-trafodion","forks_url":"https://api.github.com/repos/apache/incubator-trafodion/forks","keys_url":"https://api.github.com/repos/apache/incubator-trafodion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-trafodion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-trafodion/teams","hooks_url":"https://api.github.com/repos/apache/incubator-trafodion/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-trafodion/events","assignees_url":"https://api.github.com/repos/apache/incubator-trafodion/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-trafodion/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-trafodion/tags","blobs_url":"https://api.github.com/repos/apache/incubator-trafodion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-trafodion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-trafodion/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-trafodion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-trafodion/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-trafodion/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-trafodion/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-trafodion/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-trafodion/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-trafodion/subscription","commits_url":"https://api.github.com/repos/apache/incubator-trafodion/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-trafodion/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-trafodion/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-trafodion/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-trafodion/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-trafodion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-trafodion/merges","archive_url":"https://api.github.com/repos/apache/incubator-trafodion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-trafodion/downloads","issues_url":"https://api.github.com/repos/apache/incubator-trafodion/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-trafodion/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-trafodion/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-trafodion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-trafodion/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-trafodion/releases{/id}","created_at":"2015-05-27T07:00:05Z","updated_at":"2015-11-18T18:46:04Z","pushed_at":"2015-11-19T17:13:02Z","git_url":"git://github.com/apache/incubator-trafodion.git","ssh_url":"git@github.com:apache/incubator-trafodion.git","clone_url":"https://github.com/apache/incubator-trafodion.git","svn_url":"https://github.com/apache/incubator-trafodion","homepage":null,"size":61816,"stargazers_count":22,"watchers_count":22,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":51,"mirror_url":"git://git.apache.org/incubator-trafodion.git","open_issues_count":7,"forks":51,"open_issues":7,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182"},"html":{"href":"https://github.com/apache/incubator-trafodion/pull/182"},"issue":{"href":"https://api.github.com/repos/apache/incubator-trafodion/issues/182"},"comments":{"href":"https://api.github.com/repos/apache/incubator-trafodion/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-trafodion/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-trafodion/statuses/8f658efa21fea35336f8b814bb37d1f5c2bbf3da"}}}}