Check-in [48a9cde717]
Overview
Comment:Added missing call to free()
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 48a9cde717ab2444aae2470d7f5fa054ff5d8dcf
User & Date: rkeene on 2014-05-04 07:17:27
Other Links: manifest | tags
Context
2014-05-04
07:20
Yet another call to free() missing check-in: 75e4672f6a user: rkeene tags: trunk
07:17
Added missing call to free() check-in: 48a9cde717 user: rkeene tags: trunk
07:04
tcc4tcl version 0.3 check-in: df44ccaed5 user: rkeene tags: trunk, 0.3
Changes

Modified build/tcc-patches/0.9.26/tcc-0.9.26-win32useopenlibs.diff from [269482c81f] to [21b33f7611].

     1      1   diff -uNr tcc-0.9.26.orig/tccpe.c tcc-0.9.26-1win32useopenlibs/tccpe.c
     2      2   --- tcc-0.9.26.orig/tccpe.c	2013-02-15 08:24:00.000000000 -0600
     3         -+++ tcc-0.9.26-1win32useopenlibs/tccpe.c	2014-05-04 02:00:45.195490003 -0500
            3  ++++ tcc-0.9.26-1win32useopenlibs/tccpe.c	2014-05-04 02:16:34.590555001 -0500
     4      4   @@ -38,6 +38,9 @@
     5      5    # define ADDR3264 DWORD
     6      6    #endif
     7      7    
     8      8   +#ifdef TCC_IS_NATIVE
     9      9   +#include <psapi.h>
    10     10   +#endif
    11     11    #ifdef _WIN32
    12     12    void dbg_printf (const char *fmt, ...)
    13     13    {
    14         -@@ -831,7 +834,26 @@
           14  +@@ -831,7 +834,27 @@
    15     15                        if (dllref) {
    16     16                            if ( !dllref->handle )
    17     17                                dllref->handle = LoadLibrary(dllref->name);
    18     18   -                        v = (ADDR3264)GetProcAddress(dllref->handle, name);
    19     19   +                        if (dllref->handle) {
    20     20   +                            v = (ADDR3264)GetProcAddress(dllref->handle, name);
    21     21   +                        }
................................................................................
    32     32   +                            for (i = 0; i < needed / sizeof(HMODULE); i++) {
    33     33   +                                v = (ADDR3264)GetProcAddress(modules[i], name);
    34     34   +                                if (v) {
    35     35   +                                    break;
    36     36   +                                }
    37     37   +                            }
    38     38   +                        }
           39  ++                        tcc_free(modules);
    39     40                        }
    40     41                        if (!v)
    41     42                            tcc_error_noabort("undefined symbol '%s'", name);
    42         -@@ -1209,9 +1231,34 @@
           43  +@@ -1209,9 +1232,34 @@
    43     44    
    44     45                const char *name = symtab_section->link->data + sym->st_name;
    45     46                unsigned type = ELFW(ST_TYPE)(sym->st_info);
    46     47   -            int imp_sym = pe_find_import(pe->s1, sym);
    47     48   +            int imp_sym;
    48     49                struct import_symbol *is;
    49     50