diff Framework/PostgreSQL/PostgreSQLLargeObject.cpp @ 1:d17b2631bb67

starting StorageBackend
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Jul 2018 18:05:24 +0200
parents 7cea966b6829
children 714c5d2bee76
line wrap: on
line diff
--- a/Framework/PostgreSQL/PostgreSQLLargeObject.cpp	Wed Jul 04 08:16:29 2018 +0200
+++ b/Framework/PostgreSQL/PostgreSQLLargeObject.cpp	Wed Jul 04 18:05:24 2018 +0200
@@ -200,6 +200,11 @@
     else
     {
       target = malloc(size);
+      if (target == NULL)
+      {
+        throw Orthanc::OrthancException(Orthanc::ErrorCode_NotEnoughMemory);
+      }
+      
       reader.Read(reinterpret_cast<char*>(target));
     }
   }