* undelfs.c (undelfs_open): Use g_try_malloc() instead

of g_malloc().

        * smbfs.c (smbfs_send): Don't account negative "ret".
This commit is contained in:
Andrew V. Samoilov 2004-10-16 19:19:27 +00:00
parent 959955939d
commit e4d7245a11
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2004-10-17 Andrew V. Samoilov <sav@bcs.zp.ua>
* undelfs.c (undelfs_open): Use g_try_malloc() instead
of g_malloc().
* smbfs.c (smbfs_send): Don't account negative "ret".
2004-10-16 Roland Illig <roland.illig@gmx.de>
* tar.c (tar_read_header): Fixed handling of filenames starting

View File

@ -602,9 +602,11 @@ smbfs_send(struct cli_state *cli)
while (nwritten < len) {
ret = write_socket(cli->fd, cli->outbuf+nwritten, len - nwritten);
if (ret <= 0 && errno == EPIPE)
if (ret <= 0) {
if (errno == EPIPE)
return False;
nwritten += ret;
} else
nwritten += ret;
}
return True;

View File

@ -423,13 +423,13 @@ undelfs_open (struct vfs_class *me, const char *fname, int flags, int mode)
continue;
/* Found: setup all the structures needed by read */
p = g_new (undelfs_file, 1);
p = (undelfs_file *) g_try_malloc (((gsize) sizeof (undelfs_file)));
if (!p) {
g_free (file);
g_free (f);
return 0;
}
p->buf = g_malloc (fs->blocksize);
p->buf = g_try_malloc (fs->blocksize);
if (!p->buf) {
g_free (p);
g_free (file);