diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2cfac1c6f7a6796f20eb00e7e2769d9c06c38133..f19cc2946637dea895b30bc22a2df922ac12088b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@
 
 cmake_minimum_required(VERSION 3.14)
 
-set(libcaosdb_VERSION 0.0.4)
+set(libcaosdb_VERSION 0.0.5)
 
 project(libcaosdb
     VERSION ${libcaosdb_VERSION}
diff --git a/conanfile.py b/conanfile.py
index 88d6c987dbbbf4441de6509d5b479b5f07aeca6e..c8bba233c8a953d1a72e078629631029c902f25b 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -3,7 +3,7 @@ from conans import ConanFile, CMake, tools
 
 class CaosdbConan(ConanFile):
     name = "caosdb"
-    version = "0.0.4"
+    version = "0.0.5"
     license = "AGPL-3.0-or-later"
     author = "Timm C. Fitschen <t.fitschen@indiscale.com>"
     url = "https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git"
diff --git a/src/ccaosdb.cpp b/src/ccaosdb.cpp
index 076b23e3bc95148c50a777b8db735f102d39d262..4465c78654f76548d64ad6b7fa012fdfea386591 100644
--- a/src/ccaosdb.cpp
+++ b/src/ccaosdb.cpp
@@ -1,3 +1,5 @@
+#include <iostream>
+#include <stdio.h>
 #include "caosdb/utility.h"
 #include "caosdb/constants.h"
 #include "caosdb/connection.h"
@@ -121,8 +123,17 @@ int caosdb_connection_get_version_info(
   out->minor = (int)version_info->GetMinor();
   out->patch = (int)version_info->GetPatch();
 
-  out->pre_release = version_info->GetPreRelease().c_str();
-  out->build = version_info->GetBuild().c_str();
+  // copy pre_release, needs local variable because out->pre_release is const
+  char *pre_release =
+    (char *)malloc(sizeof(char) * (version_info->GetPreRelease().length() + 1));
+  strcpy(pre_release, version_info->GetPreRelease().c_str());
+  out->pre_release = pre_release;
+
+  // copy build, needs local variable because out->build is const
+  char *build =
+    (char *)malloc(sizeof(char) * (version_info->GetBuild().length() + 1));
+  strcpy(build, version_info->GetBuild().c_str());
+  out->build = build;
 
   return 0;
 }