}
std::string dataStr = data;
- delete data;
+ delete[] data;
// replace $VALUE, $KEY to data from database
std::ostringstream jsOstring;
jsOstring << dataStr;
if (type_t == NULL) {
_E("no available memory\n");
__preexec_list_free();
+ fclose(preexec_file);
return;
}
_E("no available memory\n");
free(type_t);
__preexec_list_free();
+ fclose(preexec_file);
return;
}
type_t->so_path = strdup(sopath);
free(type_t->pkg_type);
free(type_t);
__preexec_list_free();
+ fclose(preexec_file);
return;
}
type_t->dl_do_pre_exe = func;
free(kb_data);
free(hd);
} else {
- hd = (struct history_data *)malloc(sizeof(char) * 1033);
+ hd = (struct history_data *)malloc(sizeof(struct history_data));
strncpy(hd->pkg_name, pkgname, MAX_PACKAGE_STR_SIZE-1);
strncpy(hd->app_path, app_path, MAX_PACKAGE_APP_PATH_SIZE-1);
while (fgets(soname, MAX_LOCAL_BUFSZ, preload_list) > (char*)0) {
soname[strlen(soname) - 1] = 0;
- handle = dlopen(soname, RTLD_NOW|RTLD_GLOBAL);
+ handle = dlopen((const char *)soname, RTLD_NOW|RTLD_GLOBAL);
if (handle == NULL)
continue;
_D("preload %s# - handle : %x\n", soname, handle);
/* Create basedir for our sockets */
orig_mask = umask(0);
- mkdir(AUL_SOCK_PREFIX, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
+ (void) mkdir(AUL_SOCK_PREFIX, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
umask(orig_mask);
fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (listen(fd, 10) == -1) {
_E("listen error");
+ close(fd);
return -1;
}
return (-1); /* select error: sockfd not set*/
done:
- fcntl(fd, F_SETFL, flags);
+ (void) fcntl(fd, F_SETFL, flags);
if (error) {
close(fd);
errno = error;