asprintf() doesn't return an error number, but a count of characters
(which we don't need.)
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
struct stat st;
int err = 0;
- err = asprintf(&file, "%s%s%s",
- path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/", cfg);
+ asprintf(&file, "%s%s%s",
+ path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/", cfg);
if (!file) {
perror(program);
if (fd >= 0)
close(fd);
- if (file)
- free(file);
+
+ free(file);
return err;
}