diff --git a/lib/vfs/mc-vfs/ftpfs.c b/lib/vfs/mc-vfs/ftpfs.c
index fc6f3d5..1ccee01 100644
a
|
b
|
ftpfs_load_no_proxy_list (void) |
597 | 597 | np->domain = g_strdup (s); |
598 | 598 | np->next = NULL; |
599 | 599 | if (no_proxy) |
600 | | current->next = np; |
| 600 | current->next = np; /* FIXME: potential null derefence */ |
601 | 601 | else |
602 | 602 | no_proxy = np; |
603 | 603 | current = np; |
diff --git a/lib/vfs/mc-vfs/samba/lib/charset.c b/lib/vfs/mc-vfs/samba/lib/charset.c
index 58be253..d021c69 100644
a
|
b
|
clean_and_exit: |
315 | 315 | |
316 | 316 | if(fp != NULL) |
317 | 317 | fclose(fp); |
318 | | if(cp_p) |
319 | | free((char *)cp_p); |
| 318 | |
| 319 | free((char *)cp_p); |
320 | 320 | return NULL; |
321 | 321 | } |
322 | 322 | |
diff --git a/lib/vfs/mc-vfs/samba/lib/util.c b/lib/vfs/mc-vfs/samba/lib/util.c
index 98df37a..bec32ec 100644
a
|
b
|
void *Realloc(void *p,size_t size) |
1642 | 1642 | void *ret=NULL; |
1643 | 1643 | |
1644 | 1644 | if (size == 0) { |
1645 | | if (p) free(p); |
| 1645 | free(p); |
1646 | 1646 | DEBUG(5,("Realloc asked for 0 bytes\n")); |
1647 | 1647 | return NULL; |
1648 | 1648 | } |
1649 | 1649 | |
1650 | | if (!p) |
| 1650 | if (!p) |
1651 | 1651 | ret = (void *)malloc(size); |
1652 | 1652 | else |
1653 | 1653 | ret = (void *)realloc(p,size); |
diff --git a/lib/vfs/mc-vfs/samba/lib/util_str.c b/lib/vfs/mc-vfs/samba/lib/util_str.c
index 74b5303..64611e2 100644
a
|
b
|
void string_free(char **s) |
980 | 980 | if (!s || !(*s)) return; |
981 | 981 | if (*s == null_string) |
982 | 982 | *s = NULL; |
983 | | if (*s) free(*s); |
| 983 | free(*s); |
984 | 984 | *s = NULL; |
985 | 985 | } |
986 | 986 | |
diff --git a/lib/vfs/mc-vfs/samba/libsmb/clientgen.c b/lib/vfs/mc-vfs/samba/libsmb/clientgen.c
index 0dd0710..0a16a14 100644
a
|
b
|
int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, co |
591 | 591 | DEBUG(4,("NetShareEnum failed\n")); |
592 | 592 | } |
593 | 593 | |
594 | | if (rparam) |
595 | | free(rparam); |
596 | | if (rdata) |
597 | | free(rdata); |
| 594 | free(rparam); |
| 595 | free(rdata); |
598 | 596 | |
599 | 597 | return count; |
600 | 598 | } |
… |
… |
BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, |
664 | 662 | } |
665 | 663 | } |
666 | 664 | |
667 | | if (rparam) |
668 | 665 | free(rparam); |
669 | | if (rdata) |
670 | 666 | free(rdata); |
671 | 667 | |
672 | 668 | return(count > 0); |
… |
… |
BOOL cli_qfileinfo(struct cli_state *cli, int fnum, |
1884 | 1880 | *ino = IVAL(rdata, 64); |
1885 | 1881 | } |
1886 | 1882 | |
1887 | | if (rdata) free(rdata); |
1888 | | if (rparam) free(rparam); |
| 1883 | free(rdata); |
| 1884 | free(rparam); |
1889 | 1885 | return True; |
1890 | 1886 | } |
1891 | 1887 | |
… |
… |
int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, |
2141 | 2137 | |
2142 | 2138 | total_received += ff_searchcount; |
2143 | 2139 | |
2144 | | if (rdata) free(rdata); rdata = NULL; |
2145 | | if (rparam) free(rparam); rparam = NULL; |
| 2140 | free(rdata); rdata = NULL; |
| 2141 | free(rparam); rparam = NULL; |
2146 | 2142 | |
2147 | 2143 | DEBUG(3,("received %d entries (eos=%d resume=%d)\n", |
2148 | 2144 | ff_searchcount,ff_eos,ff_resume_key)); |
… |
… |
int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, |
2156 | 2152 | } |
2157 | 2153 | |
2158 | 2154 | /* free up the dirlist buffer */ |
2159 | | if (dirlist) free(dirlist); |
| 2155 | free(dirlist); |
2160 | 2156 | return(total_received); |
2161 | 2157 | } |
2162 | 2158 | |
… |
… |
shutdown a client structure |
2403 | 2399 | ****************************************************************************/ |
2404 | 2400 | void cli_shutdown(struct cli_state *cli) |
2405 | 2401 | { |
2406 | | if (cli->outbuf) |
2407 | | { |
2408 | | free(cli->outbuf); |
2409 | | } |
2410 | | if (cli->inbuf) |
2411 | | { |
2412 | | free(cli->inbuf); |
2413 | | } |
| 2402 | free(cli->outbuf); |
| 2403 | free(cli->inbuf); |
2414 | 2404 | #ifdef WITH_SSL |
2415 | 2405 | if (cli->fd != -1) |
2416 | 2406 | sslutil_disconnect(cli->fd); |
diff --git a/lib/vfs/mc-vfs/samba/libsmb/nmblib.c b/lib/vfs/mc-vfs/samba/libsmb/nmblib.c
index 85a01aa..e9d7265 100644
a
|
b
|
struct packet_struct *copy_packet(struct packet_struct *packet) |
620 | 620 | ******************************************************************/ |
621 | 621 | static void free_nmb_packet(struct nmb_packet *nmb) |
622 | 622 | { |
623 | | if (nmb->answers) free(nmb->answers); |
624 | | if (nmb->nsrecs) free(nmb->nsrecs); |
625 | | if (nmb->additional) free(nmb->additional); |
| 623 | free(nmb->answers); |
| 624 | free(nmb->nsrecs); |
| 625 | free(nmb->additional); |
626 | 626 | } |
627 | 627 | |
628 | 628 | /******************************************************************* |
diff --git a/lib/vfs/mc-vfs/samba/param/loadparm.c b/lib/vfs/mc-vfs/samba/param/loadparm.c
index 7e4ad2e..bc955e5 100644
a
|
b
|
free the dynamically allocated parts of a service struct |
1319 | 1319 | static void free_service(service *pservice) |
1320 | 1320 | { |
1321 | 1321 | int i; |
| 1322 | |
1322 | 1323 | if (!pservice) |
1323 | 1324 | return; |
1324 | 1325 | |
… |
… |
static void free_service(service *pservice) |
1326 | 1327 | DEBUG(5,("free_service: Freeing service %s\n", pservice->szService)); |
1327 | 1328 | |
1328 | 1329 | string_free(&pservice->szService); |
1329 | | if (pservice->copymap) |
1330 | | { |
1331 | | free(pservice->copymap); |
1332 | | pservice->copymap = NULL; |
1333 | | } |
| 1330 | |
| 1331 | free(pservice->copymap); |
| 1332 | pservice->copymap = NULL; |
1334 | 1333 | |
1335 | 1334 | for (i=0;parm_table[i].label;i++) |
1336 | 1335 | if ((parm_table[i].type == P_STRING || |
… |
… |
initialise a copymap |
1849 | 1848 | static void init_copymap(service *pservice) |
1850 | 1849 | { |
1851 | 1850 | size_t i; |
1852 | | if (pservice->copymap) free(pservice->copymap); |
| 1851 | |
| 1852 | free(pservice->copymap); |
| 1853 | |
1853 | 1854 | pservice->copymap = (BOOL *)malloc(sizeof(BOOL)*NUMPARAMETERS); |
1854 | 1855 | if (!pservice->copymap) |
1855 | 1856 | DEBUG(0,("Couldn't allocate copymap!! (size %d)\n",(int)NUMPARAMETERS)); |
diff --git a/lib/vfs/mc-vfs/tar.c b/lib/vfs/mc-vfs/tar.c
index 817194c..6d22208 100644
a
|
b
|
tar_read_header (struct vfs_class *me, struct vfs_s_super *archive, |
644 | 644 | while (tar_get_next_record (archive, tard)->ext_hdr. |
645 | 645 | isextended); |
646 | 646 | inode->data_offset = current_tar_position; |
| 647 | /* FIXME: potential null derefence 'inode' */ |
647 | 648 | } |
648 | 649 | return STATUS_SUCCESS; |
649 | 650 | } |
diff --git a/src/man2hlp.c b/src/man2hlp.c
index aa95df6..c578c9f 100644
a
|
b
|
main (int argc, char **argv) |
838 | 838 | fprintf (f_out, "\n"); |
839 | 839 | |
840 | 840 | free (cnode->node); |
841 | | if (cnode->lname) |
842 | 841 | free (cnode->lname); |
843 | 842 | if (cnode != &nodes) |
844 | 843 | free (cnode); |
diff --git a/src/mountlist.c b/src/mountlist.c
index 86dd361..1b48243 100644
a
|
b
|
static void free_mount_entry (struct mount_entry *me) |
155 | 155 | { |
156 | 156 | if (!me) |
157 | 157 | return; |
158 | | if (me->me_devname) |
| 158 | |
159 | 159 | free (me->me_devname); |
160 | | if (me->me_mountdir) |
161 | 160 | free (me->me_mountdir); |
162 | | if (me->me_type) |
163 | 161 | free (me->me_type); |
164 | 162 | free (me); |
165 | 163 | } |
diff --git a/src/viewer/display.c b/src/viewer/display.c
index d027cc2..b6e06dd 100644
a
|
b
|
mcview_display_status (mcview_t * view) |
129 | 129 | const screen_dimen width = view->status_area.width; |
130 | 130 | const screen_dimen height = view->status_area.height; |
131 | 131 | const char *file_label; |
132 | | screen_dimen file_label_width, i = 0; |
| 132 | screen_dimen file_label_width; |
133 | 133 | |
134 | 134 | if (height < 1) |
135 | 135 | return; |