Mercurial > gftp.yaz
diff lib/protocols.c @ 598:fa0838b22b14
2004-10-29 Brian Masney <masneyb@gftp.org>
* lib/gftp.h lib/misc.c lib/protocols.c lib/rfc2068.c lib/rfc959.c
lib/sshv2.c src/gtk/dnd.c src/gtk/view_dialog.c src/uicommon/gftpui.c
src/uicommon/gftpuicallbacks.c - removed free_fdata(). Added
free_it parameter to gftp_file_destroy()
author | masneyb |
---|---|
date | Fri, 29 Oct 2004 20:05:32 +0000 |
parents | 5df46f79d9c1 |
children | 0999b11f84e3 |
line wrap: on
line diff
--- a/lib/protocols.c Wed Oct 27 22:18:30 2004 +0000 +++ b/lib/protocols.c Fri Oct 29 20:05:32 2004 +0000 @@ -100,7 +100,7 @@ void -gftp_file_destroy (gftp_file * file) +gftp_file_destroy (gftp_file * file, int free_it) { g_return_if_fail (file != NULL); @@ -114,7 +114,11 @@ g_free (file->group); if (file->destfile) g_free (file->destfile); - memset (file, 0, sizeof (*file)); + + if (free_it) + g_free (file); + else + memset (file, 0, sizeof (*file)); } @@ -442,8 +446,8 @@ gftp_string_to_utf8 (gftp_request * request, const char *str) { char *ret, *remote_charsets, *stpos, *cur_charset, *tempstr; + GError * error = NULL; gsize bread, bwrite; - GError * error; if (request == NULL) return (NULL); @@ -511,8 +515,8 @@ gftp_string_from_utf8 (gftp_request * request, const char *str) { char *ret, *remote_charsets, *stpos, *cur_charset, *tempstr; + GError * error = NULL; gsize bread, bwrite; - GError * error; if (request == NULL) return (NULL); @@ -614,7 +618,7 @@ memset (fle, 0, sizeof (*fle)); do { - gftp_file_destroy (fle); + gftp_file_destroy (fle, 0); ret = request->get_next_file (request, fle, fd); if (ret >= 0 && fle->file != NULL) @@ -1847,7 +1851,7 @@ *newsize = fle->size; g_hash_table_insert (dirhash, newname, newsize); fle->file = NULL; - gftp_file_destroy (fle); + gftp_file_destroy (fle, 0); } gftp_end_transfer (request); g_free (fle); @@ -1907,7 +1911,7 @@ { if (strcmp (fle->file, ".") == 0 || strcmp (fle->file, "..") == 0) { - gftp_file_destroy (fle); + gftp_file_destroy (fle, 0); continue; } @@ -1938,8 +1942,7 @@ } gftp_end_transfer (transfer->fromreq); - gftp_file_destroy (fle); - g_free (fle); + gftp_file_destroy (fle, 1); if (dirhash != NULL) gftp_destroy_dir_hash (dirhash);