[Datacontol] - fixing a bug in the function SQLColumnValue
authorAndrzej Popowski <a.popowski@samsung.com>
Mon, 8 Jun 2015 12:13:26 +0000 (14:13 +0200)
committerAndrzej Popowski <a.popowski@samsung.com>
Mon, 8 Jun 2015 12:13:26 +0000 (14:13 +0200)
Change-Id: Id95e21b44eac8a5f4c9edf4e4bce184158ebd3c7
Signed-off-by: Andrzej Popowski <a.popowski@samsung.com>
src/datacontrol/datacontrol_instance.cc

index 27dd2b96937906fda04aadd233cc56fbb44fcb51..c0df1ccafc29cab37cf336e440a7b8d5c0439ba5 100755 (executable)
@@ -151,7 +151,10 @@ static bool SQLColumnValue(result_set_cursor cursor, int columnIndex,
       char *buffer = new char[size + 1];
       result =
           data_control_sql_get_blob_data(cursor, columnIndex, buffer, size);
-      if (result != DATA_CONTROL_ERROR_NONE) break;
+      if (result != DATA_CONTROL_ERROR_NONE) {
+        delete[] buffer;
+        break;
+      }
       val = picojson::value(buffer);
       delete[] buffer;
       break;