Commit 05e3956a by Celine Mercier

Minor changes in code to improve readability (freeing some character

strings earlier)
parent 9b066f43
......@@ -988,7 +988,7 @@ OBIDMS_array_p obi_open_array(OBIDMS_p dms, const char* array_name)
}
int obi_close_array(OBIDMS_array_p array)
int obi_close_array(OBIDMS_array_p array) // TODO when do we call it? (as multiple threads can be using the same array)
{
int ret_val = 0;
......
......@@ -145,12 +145,14 @@ OBIDMS_p obi_create_dms(const char* dms_name)
free(directory_name);
return NULL;
}
free(directory_name);
dms_file_descriptor = dirfd(dms_dir);
if (dms_file_descriptor < 0)
{
obi_set_errno(OBIDMS_UNKNOWN_ERROR);
obidebug(1, "\nProblem getting the file descriptor of a newly created OBIDMS directory");
free(directory_name);
return NULL;
}
......@@ -159,11 +161,9 @@ OBIDMS_p obi_create_dms(const char* dms_name)
{
obi_set_errno(OBI_ARRAY_ERROR);
obidebug(1, "\nProblem creating an arrays directory");
free(directory_name);
return NULL;
}
free(directory_name);
return obi_open_dms(dms_name);
}
......
......@@ -341,6 +341,8 @@ index_t obi_column_get_element_index_from_name(OBIDMS_column_p column, const cha
/**
* @brief Formats a date in a way that is easy to read.
*
* @warning The pointer returned must be freed by the caller.
*
* @param date A date.
*
* @returns The date formatted in a way that is easy to read.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment