diff Plugins/Samples/StorageArea/Plugin.cpp @ 1304:7b6925b0890d

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Feb 2015 17:03:17 +0100
parents 6e7e5ed91c2d
children 3d76e26b3865
line wrap: on
line diff
--- a/Plugins/Samples/StorageArea/Plugin.cpp	Tue Feb 10 16:47:24 2015 +0100
+++ b/Plugins/Samples/StorageArea/Plugin.cpp	Tue Feb 10 17:03:17 2015 +0100
@@ -96,7 +96,7 @@
   else
   {
     *content = malloc(*size);
-    if (content == NULL ||
+    if (*content == NULL ||
         fread(*content, *size, 1, fp) != 1)
     {
       ok = false;
@@ -121,14 +121,13 @@
 {
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c)
   {
-    char info[1024];
-
     context = c;
     OrthancPluginLogWarning(context, "Storage plugin is initializing");
 
     /* Check the version of the Orthanc core */
     if (OrthancPluginCheckVersion(c) == 0)
     {
+      char info[1024];
       sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin",
               c->orthancVersion,
               ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,