ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/interp2d.c
(Generate patch)

Comparing ray/src/common/interp2d.c (file contents):
Revision 2.16 by greg, Thu Mar 11 01:58:59 2021 UTC vs.
Revision 2.17 by greg, Fri Mar 19 21:16:15 2021 UTC

# Line 96 | Line 96 | interp2_realloc(INTERP2 *ip, int nsamps)
96          }
97          ip = (INTERP2 *)realloc(ip, sizeof(INTERP2)+sizeof(float)*2*(nsamps-1));
98          if (ip == NULL) {
99 <                if (nsamps <= ip->ns)
99 >                if (nsamps <= ip->ns) {
100                          ip = old_ip;
101 <                else
101 >                } else {
102 >                        free(old_ip);
103                          return(NULL);
104 +                }
105          }
106          ip->ns = nsamps;
107          return(ip);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines