[package] opkg: fix invalid free triggered by 011-old-config-location.patch and repla...
[openwrt-10.03/.git] / package / opkg / patches / 012-cleanup-tmpdir.patch
1 --- a/src/opkg-cl.c
2 +++ b/src/opkg-cl.c
3 @@ -263,7 +263,7 @@
4  int
5  main(int argc, char *argv[])
6  {
7 -       int opts;
8 +       int opts, err = -1;
9         char *cmd_name;
10         opkg_cmd_t *cmd;
11         int nocheckfordirorfile = 0;
12 @@ -327,15 +327,8 @@
13                 usage();
14         }
15  
16 -       if (opkg_cmd_exec(cmd, argc - opts, (const char **) (argv + opts)))
17 -               goto err2;
18 +       err = opkg_cmd_exec(cmd, argc - opts, (const char **) (argv + opts));
19  
20 -       print_error_list();
21 -       free_error_list();
22 -
23 -       return 0;
24 -
25 -err2:
26  #ifdef HAVE_CURL
27         opkg_curl_cleanup();
28  #endif
29 @@ -346,5 +339,5 @@
30         print_error_list();
31         free_error_list();
32  
33 -       return -1;
34 +       return err;
35  }