fd = fopen("/proc/self/attr/current", "r");
if (fd == NULL) {
DNSSD_LOGE("Failed to open /proc/self/attr/current");
+ cynara_finish(p_cynara);
return false;
}
ret = fread(smack_label, SMACK_LABEL_LEN, 1, fd);
if (ret == 0 && ferror(fd)) {
DNSSD_LOGE("Failed to read /proc/self/attr/current");
- fclose(fd);
+ if (fclose(fd) != 0)
+ DNSSD_LOGE("Failed to fclose");
+ cynara_finish(p_cynara);
return false;
}
- fclose(fd);
+ if (fclose(fd) != 0)
+ DNSSD_LOGE("Failed to fclose");
snprintf(uid, sizeof(uid), "%d", getuid());
fd = fopen("/proc/self/attr/current", "r");
if (fd == NULL) {
SSDP_LOGE("Failed to open /proc/self/attr/current");
+ cynara_finish(p_cynara);
return false;
}
ret = fread(smack_label, SMACK_LABEL_LEN, 1, fd);
if (ret == 0 && ferror(fd)) {
SSDP_LOGE("Failed to read /proc/self/attr/current");
- fclose(fd);
+ if (fclose(fd) != 0)
+ SSDP_LOGE("Failed to fclose");
+ cynara_finish(p_cynara);
return false;
}
- fclose(fd);
+ if (fclose(fd) != 0)
+ SSDP_LOGE("Failed to fclose");
snprintf(uid, sizeof(uid), "%d", getuid());