Changeset: 99d10f1de249 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99d10f1de249
Modified Files:
        common/stream/stream.c
        monetdb5/mal/mal_linker.c
Branch: default
Log Message:

Merge with Jul2017


diffs (51 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -962,6 +962,8 @@ open_stream(const char *filename, const 
 
 #ifdef HAVE_LIBZ
 #if ZLIB_VERNUM < 0x1290
+typedef size_t z_size_t;
+
 /* simplistic version for ancient systems (CentOS 6, Ubuntu Trusty) */
 static z_size_t
 gzfread(void *buf, z_size_t size, z_size_t nitems, gzFile file)
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -109,7 +109,18 @@ getAddress(str fcnname)
 
        adr = (MALfcn) dlsym(dl, fcnname);
        filesLoaded[lastfile].modname = GDKstrdup("libmonetdb5");
+       if(filesLoaded[lastfile].modname == NULL) {
+               if (!silent)
+                       showException(out, MAL,"MAL.getAddress", "could not 
allocate space");
+               return NULL;
+       }
        filesLoaded[lastfile].fullname = GDKstrdup("libmonetdb5");
+       if(filesLoaded[lastfile].fullname == NULL) {
+               GDKfree(filesLoaded[lastfile].modname);
+               if (!silent)
+                       showException(out, MAL,"MAL.getAddress", "could not 
allocate space");
+               return NULL;
+       }
        filesLoaded[lastfile].handle = dl;
        lastfile ++;
        return adr;
@@ -229,7 +240,16 @@ loadLibrary(str filename, int flag)
                throw(MAL,"mal.linker", "loadModule internal error, too many 
modules loaded");
        } else {
                filesLoaded[lastfile].modname = GDKstrdup(filename);
+               if(filesLoaded[lastfile].modname == NULL) {
+                       MT_lock_unset(&mal_contextLock);
+                       throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR " could 
not allocate space");
+               }
                filesLoaded[lastfile].fullname = GDKstrdup(handle ? nme : "");
+               if(filesLoaded[lastfile].fullname == NULL) {
+                       GDKfree(filesLoaded[lastfile].modname);
+                       MT_lock_unset(&mal_contextLock);
+                       throw(LOADER, "loadLibrary", RUNTIME_LOAD_ERROR " could 
not allocate space");
+               }
                filesLoaded[lastfile].handle = handle ? handle : 
filesLoaded[0].handle;
                lastfile ++;
        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to