coverity: #1436916

Resource leak Signed-off-by: 's avatarDonghwa Jeong <dh48.jeong@samsung.com>
parent 2b65c74c
...@@ -101,8 +101,10 @@ static bool lookup_user(const char *optarg, uid_t *uid) ...@@ -101,8 +101,10 @@ static bool lookup_user(const char *optarg, uid_t *uid)
if (sscanf(optarg, "%u", uid) < 1) { if (sscanf(optarg, "%u", uid) < 1) {
/* not a uid -- perhaps a username */ /* not a uid -- perhaps a username */
if (sscanf(optarg, "%s", name) < 1) if (sscanf(optarg, "%s", name) < 1) {
free(buf);
return false; return false;
}
ret = getpwnam_r(name, &pwent, buf, bufsize, &pwentp); ret = getpwnam_r(name, &pwent, buf, bufsize, &pwentp);
if (!pwentp) { if (!pwentp) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment