fix typo.
[vuplus_openvuplus] / meta-openvuplus / recipes-base / autofs / autofs-4.1.4 / 062_fix_memory_leak.patch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 062_fix_memory_leak.dpatch
3 ##
4 ## DP: No description.
5
6 @DPATCH@
7
8 diff -Naur .B/modules/mount_nfs.c .A/modules/mount_nfs.c
9 --- .B/modules/mount_nfs.c      2007-01-07 21:36:35.000000000 +0000
10 +++ .A/modules/mount_nfs.c      2007-01-07 21:36:35.000000000 +0000
11 @@ -145,16 +145,20 @@
12         he = gethostbyname(hostname);
13         if (!he) {
14                 error(MODPREFIX "host %s: lookup failure", hostname);
15 +               free(hostname);
16                 return -1;
17         }
18  
19         for (haddr = he->h_addr_list; *haddr; haddr++) {
20                 local = is_local_addr(hostname, *haddr, he->h_length);
21 -               if (local < 0) 
22 +               if (local < 0) {
23 +                       free(hostname);
24                         return local;
25 +               }
26                 if (local) {
27                         debug(MODPREFIX "host %s: is localhost",
28                                         hostname);
29 +                       free(hostname);
30                         return local;
31                 }
32         }