+Mon Mar 16 11:40:00 CET 2009 Daniel Veillard <veillard@redhat.com>
+
+ * qemud/qemud.c src/cgroup.c src/uml_driver.c src/util.c: close
+ some potential FILE * leaks
+
Mon Mar 16 10:35:00 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
* qemud/event.c: Fix dispatch of FD events when one or more
if (fprintf(fh, "%lu\n", (unsigned long)getpid()) < 0) {
VIR_ERROR(_("Failed to write to pid file '%s' : %s"),
pidFile, virStrerror(errno, ebuf, sizeof ebuf));
- close(fd);
+ fclose(fh);
return -1;
}
static virCgroupPtr virCgroupGetMount(const char *controller)
{
- FILE *mounts;
+ FILE *mounts = NULL;
struct mntent entry;
char buf[CGROUP_MAX_VAL];
virCgroupPtr root = NULL;
return root;
err:
+ if (mounts != NULL)
+ fclose(mounts);
virCgroupFree(&root);
return NULL;
if (fscanf(file, "%d", &vm->pid) != 1) {
errno = EINVAL;
+ fclose(file);
goto cleanup;
}
if (fscanf(pidinfo, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu", &usertime, &systime) != 2) {
umlDebug("not enough arg");
+ fclose(pidinfo);
return -1;
}
if (fscanf(file, "%d", pid) != 1) {
rc = EINVAL;
+ fclose(file);
goto cleanup;
}