bool is_dup, uid_t uid, char **dev_node)
{
int ret = APP2EXT_SUCCESS;
- char *passwd = NULL;
+ char *passwd;
char dmcrypt_open_cmd[BUF_SIZE] = { 0, };
char dev_name[BUF_SIZE] = { 0, };
char buf[BUF_SIZE] = { 0, };
_E("app2sd db initialize failed");
return APP2EXT_ERROR_DB_INITIALIZE;
}
- if ((passwd = _app2sd_get_password_from_db(pkgid, uid)) == NULL) {
+
+ passwd = _app2sd_get_password_from_db(pkgid, uid);
+ if (passwd == NULL) {
_E("no password found for [%s]", pkgid);
return APP2EXT_ERROR_SQLITE_REGISTRY;
}
snprintf(dmcrypt_open_cmd, BUF_SIZE, "/bin/echo '%s' | /sbin/cryptsetup -q luksOpen %s %s",
passwd, loopback_device, dev_name);
+ free(passwd);
ret = system(dmcrypt_open_cmd);
if (ret) {