return -1;
}
- asprintf(&msg, "collect %d %s", pid, channel);
+ if (asprintf(&msg, "collect %d %s", pid, channel) < 0) {
+ ERR("ustcomm_request_consumer : asprintf failed (collect %d/%s)",
+ pid, channel);
+ return -1;
+ }
/* don't signal it because it's the daemon */
result = ustcomm_connect_path(path, &conn, -1);
int retval = 0;
if(sock_path) {
- asprintf(&name, "%s", sock_path);
+ if (asprintf(&name, "%s", sock_path) < 0) {
+ ERR("ustcomm_init_ustd : asprintf failed (sock_path %s)",
+ sock_path);
+ return -1;
+ }
}
else {
int result;
return -1;
}
- asprintf(&name, "%s/%s", SOCK_DIR, "ustd");
+ if (asprintf(&name, "%s/%s", SOCK_DIR, "ustd") < 0) {
+ ERR("ustcomm_init_ustd : asprintf failed (%s/ustd)",
+ SOCK_DIR);
+ return -1;
+ }
}
handle->server.listen_fd = init_named_socket(name, &handle->server.socketpath);
retval = NULL;
}
- asprintf(&retval, "%.*s", (int)(end-start), start);
+ if (asprintf(&retval, "%.*s", (int)(end-start), start) < 0) {
+ ERR("nth_token : asprintf failed (%.*s)",
+ (int)(end-start), start);
+ return NULL;
+ }
return retval;
}