Svace memory leak fixes
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / src / cloud / csr.c
index 3cb44fc..1fc2100 100644 (file)
@@ -289,6 +289,7 @@ static int GenerateCSR(char *subject, OCByteString *csr)
     {
         OIC_LOG(ERROR, TAG, "OICMalloc returned NULL on csr allocation");
         OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
+        OICFree(buf);
         return -1;
     }
     memcpy(csr->bytes, buf + bufsize - ret, ret * sizeof(uint8_t));