~ubuntu-branches/ubuntu/vivid/libzip/vivid

« back to all changes in this revision

Viewing changes to lib/zip_fclose.c

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2014-02-09 13:24:18 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140209132418-t7u2auujqnfb5rvm
Tags: 0.11.2-1
* New upstream release (Closes: #734388).
* Remove patches:
  - fix_open_nonarchive_test.patch - fixed upstream
  - fix_zipconf_path.patch - fixed upstream
  - fix_broken_decrypt.patch - fixed upstream
  - fix_autotools_tests.diff - stolen upstream
* Update debian/control:
  - add unzip to Build-Depends.
  - bump compat to 9
* Update *.install: multiarch paths.
* Update libzip2 symbols file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
ZIP_EXTERN int
43
43
zip_fclose(struct zip_file *zf)
44
44
{
45
 
    int i, ret;
 
45
    int ret;
 
46
    unsigned int i;
46
47
    
47
48
    if (zf->src)
48
49
        zip_source_free(zf->src);
49
50
 
50
 
    for (i=0; i<zf->za->nfile; i++) {
51
 
        if (zf->za->file[i] == zf) {
52
 
            zf->za->file[i] = zf->za->file[zf->za->nfile-1];
53
 
            zf->za->nfile--;
54
 
            break;
55
 
        }
 
51
    if (zf->za) {
 
52
        for (i=0; i<zf->za->nfile; i++) {
 
53
            if (zf->za->file[i] == zf) {
 
54
                zf->za->file[i] = zf->za->file[zf->za->nfile-1];
 
55
                zf->za->nfile--;
 
56
                break;
 
57
            }
 
58
        }
56
59
    }
57
60
 
58
61
    ret = 0;
59
62
    if (zf->error.zip_err)
60
63
        ret = zf->error.zip_err;
61
64
 
 
65
    _zip_error_fini(&zf->error);
62
66
    free(zf);
63
67
    return ret;
64
68
}