Skip to content

Commit

Permalink
Use g_strndup to return a temporary string
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkn authored and kou committed Mar 6, 2020
1 parent fe26c83 commit 59724ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c_glib/arrow-glib/file-system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ const gchar *
garrow_file_system_get_type_name(GArrowFileSystem *file_system)
{
auto arrow_file_system = garrow_file_system_get_raw(file_system);
return arrow_file_system->type_name().c_str();
auto type_name = arrow_file_system->type_name();
return g_strndup(type_name.data(), type_name.size());
}

/**
Expand Down

0 comments on commit 59724ea

Please sign in to comment.