]> git.pld-linux.org Git - packages/gawk.git/blob - gawk-3.1.5-free.patch
- patches from fedora
[packages/gawk.git] / gawk-3.1.5-free.patch
1 --- gawk-3.1.5/io.c.free        2005-09-27 19:21:05.000000000 +0200
2 +++ gawk-3.1.5/io.c     2005-09-27 19:22:58.000000000 +0200
3 @@ -2479,9 +2479,12 @@
4  {
5         struct stat sbuf;
6         struct open_hook *oh;
7 +       int iop_malloced = FALSE;
8  
9 -       if (iop == NULL)
10 +       if (iop == NULL) {
11                 emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
12 +               iop_malloced = TRUE;
13 +       }
14         memset(iop, '\0', sizeof(IOBUF));
15         iop->flag = 0;
16         iop->fd = fd;
17 @@ -2494,7 +2497,8 @@
18         }
19  
20         if (iop->fd == INVALID_HANDLE) {
21 -               free(iop);
22 +               if (iop_malloced)
23 +                       free(iop);
24                 return NULL;
25         }
26         if (isatty(iop->fd))
27 @@ -2502,7 +2506,7 @@
28         iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf);
29         iop->sbuf = sbuf;
30         if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)
31 -                       lintwarn(_("data file `%s' is empty"), name);
32 +               lintwarn(_("data file `%s' is empty"), name);
33         errno = 0;
34         iop->count = iop->scanoff = 0;
35         emalloc(iop->buf, char *, iop->size += 2, "iop_alloc");
This page took 0.02491 seconds and 3 git commands to generate.