summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-07-18 17:30:38 -0500
committerNoriko Hosoi <nhosoi@redhat.com>2010-08-20 13:05:02 -0700
commit12006251e512b02e089df8e95d7efa875511feab (patch)
tree313b45d7700fc80f1112daf808f5f68a2bbb2158
parent193258fef18fdd5b7dda52d29df926aa4df50da5 (diff)
downloadds-12006251e512b02e089df8e95d7efa875511feab.tar.gz
ds-12006251e512b02e089df8e95d7efa875511feab.tar.xz
ds-12006251e512b02e089df8e95d7efa875511feab.zip
Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136
https://bugzilla.redhat.com/show_bug.cgi?id=616500 Resolves: bug 616500 Bug description: fix coverify Defect Type: Resource leaks issues CID 12121 description: Fixed resource leaks in linux_check_release().
-rw-r--r--ldap/systools/idsktune.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ldap/systools/idsktune.c b/ldap/systools/idsktune.c
index 122c41de..cd4934d9 100644
--- a/ldap/systools/idsktune.c
+++ b/ldap/systools/idsktune.c
@@ -1114,13 +1114,13 @@ linux_check_release(void)
if (fp == NULL) {
perror("popen");
- return;
+ goto done;
}
if (fgets(osl,128,fp) == NULL) {
printf("WARNING: Cannot determine the kernel number.\n");
pclose(fp);
- return;
+ goto done;
}
pclose(fp);
@@ -1131,18 +1131,20 @@ linux_check_release(void)
if (atoi(strtok(osl, ".")) < 2) {
printf("ERROR: We support kernel version 2.4.7 and higher.\n\n");
flag_os_bad = 1;
- return;
+ goto done;
}
if (atoi(strtok(NULL, ".")) < 4) {
printf("ERROR: We support kernel version 2.4.7 and higher.\n\n");
flag_os_bad = 1;
- return;
+ goto done;
}
if (atoi(strtok(NULL, "-")) < 7) {
printf("ERROR: We support kernel version 2.4.7 and higher.\n\n");
flag_os_bad = 1;
- return;
+ goto done;
}
+done:
+ if (cmd) free(cmd);
}
#endif /* IDDS_LINUX_INCLUDE */