Remove NULL checks before free() because free(NULL) performs no operation.
/* Free CIFS directories structures */
for (i = 0; i < 2; i++) {
-
- if (st_cifs[i]) {
- free(st_cifs[i]);
- }
+ free(st_cifs[i]);
}
- if (st_hdr_cifs) {
- free(st_hdr_cifs);
- }
+ free(st_hdr_cifs);
}
/*
fclose(fp);
- if (line) {
- free(line);
- }
+ free(line);
return irq;
}
* after IOC_ALLOC( blkp->desc ... ).
* Right now, we don't.
*/
- if (blkp != NULL)
- free(blkp);
- if (iocp != NULL)
- free(iocp);
+ free(blkp);
+ free(iocp);
/* Indicate that ioconf file has been parsed */
ioc_parsed = 1;
*/
void sfree_dev_list(void)
{
- if (st_dev_list) {
- free(st_dev_list);
- }
+ free(st_dev_list);
}
/*
int i;
for (i = 0; i < 2; i++) {
-
/* Free CPU structures */
- if (st_cpu[i]) {
- free(st_cpu[i]);
- }
+ free(st_cpu[i]);
/* Free I/O device structures */
- if (st_iodev[i]) {
- free(st_iodev[i]);
- }
+ free(st_iodev[i]);
}
- if (st_hdr_iodev) {
- free(st_hdr_iodev);
- }
+ free(st_hdr_iodev);
}
/*
int i;
for (i = 0; i < 3; i++) {
-
- if (st_cpu[i]) {
- free(st_cpu[i]);
- }
- if (st_irq[i]) {
- free(st_irq[i]);
- }
- if (st_irqcpu[i]) {
- free(st_irqcpu[i]);
- }
- if (st_softirqcpu[i]) {
- free(st_softirqcpu[i]);
- }
+ free(st_cpu[i]);
+ free(st_irq[i]);
+ free(st_irqcpu[i]);
+ free(st_softirqcpu[i]);
}
- if (cpu_bitmap) {
- free(cpu_bitmap);
- }
+ free(cpu_bitmap);
}
/*
fclose(fp);
- if (line) {
- free(line);
- }
+ free(line);
}
while (irq < ic_nr) {
/* Free I/O NFS directories structures */
for (i = 0; i < 2; i++) {
-
- if (st_ionfs[i]) {
- free(st_ionfs[i]);
- }
+ free(st_ionfs[i]);
}
- if (st_hdr_ionfs) {
- free(st_hdr_ionfs);
- }
+ free(st_hdr_ionfs);
}
/*
int i;
for (i = 0; i < 3; i++) {
- if (st_pid_list[i]) {
- free(st_pid_list[i]);
- }
+ free(st_pid_list[i]);
}
}
rw_pidstat_loop(dis_hdr, rows);
/* Free structures */
- if (pid_array) {
- free(pid_array);
- }
+ free(pid_array);
sfree_pid();
return 0;
close(ifd);
- if (file_actlst) {
- free(file_actlst);
- }
+ free(file_actlst);
free_structures(act);
}
close(ifd);
- if (file_actlst) {
- free(file_actlst);
- }
+ free(file_actlst);
}
/*