Browse Source

fixing the fix, @jpfr: is it okay?

Stasik0 9 years ago
parent
commit
eba0e5aa1d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/server/ua_server_worker.c

+ 4 - 0
src/server/ua_server_worker.c

@@ -205,7 +205,9 @@ static UA_StatusCode addRepeatedJob(UA_Server *server, struct AddRepeatedJob * r
         matchingTw = UA_realloc(matchingTw, sizeof(struct RepeatedJobs) +
                                 (sizeof(struct IdentifiedJob) * (matchingTw->jobsSize + 1)));
         if(!matchingTw) {
+#ifdef UA_MULTITHREADING
             UA_free(arw);
+#endif
             return UA_STATUSCODE_BADOUTOFMEMORY;
         }
 
@@ -218,7 +220,9 @@ static UA_StatusCode addRepeatedJob(UA_Server *server, struct AddRepeatedJob * r
         /* create a new entry */
         matchingTw = UA_malloc(sizeof(struct RepeatedJobs) + sizeof(struct IdentifiedJob));
         if(!matchingTw) {
+#ifdef UA_MULTITHREADING
             UA_free(arw);
+#endif
             return UA_STATUSCODE_BADOUTOFMEMORY;
         }
         matchingTw->jobsSize = 0;