diff --git a/common/utils/mem/memory.c b/common/utils/mem/memory.c index d4f09279aa..44b806dbe9 100644 --- a/common/utils/mem/memory.c +++ b/common/utils/mem/memory.c @@ -25,52 +25,6 @@ #include "common/utils/mem/oai_memory.h" #include "common/utils/LOG/log.h" -/**************************************************************************** - ** ** - ** Name: memory_get_path() ** - ** ** - ** Description: Gets the absolute path of the file where non-volatile ** - ** data are located ** - ** ** - ** Inputs: dirname: The directory where data file is located ** - ** filename: The name of the data file ** - ** Others: None ** - ** ** - ** Outputs: None ** - ** Return: The absolute path of the non-volatile data ** - ** file. The returned value is a dynamically ** - ** allocated octet string that needs to be ** - ** freed after usage. ** - ** Others: None ** - ** ** - ***************************************************************************/ -char* memory_get_path(const char* dirname, const char* filename) -{ - /* Get non-volatile data directory */ - const char* path = getenv(dirname); - - if (path == NULL) { - path = getenv(DEFAULT_NAS_PATH); - } - - if (path == NULL) { - path = "."; - } - - /* Append non-volatile data file name */ - size_t size = strlen(path) + strlen(filename) + 1; - char* data_filename = (char*)malloc(size + 1); - - if (data_filename != NULL) { - if (size != sprintf(data_filename, "%s/%s", path, filename)) { - free(data_filename); - return NULL; - } - } - - return data_filename; -} - char* memory_get_path_from_ueid(const char* dirname, const char* filename, int ueid) { /* Get non-volatile data directory */ diff --git a/common/utils/mem/oai_memory.h b/common/utils/mem/oai_memory.h index 311ad6f4d0..c09fe0b072 100644 --- a/common/utils/mem/oai_memory.h +++ b/common/utils/mem/oai_memory.h @@ -35,8 +35,6 @@ typedef unsigned char uint8_t; //----------------------------------------------------------------------------- -char* memory_get_path(const char* dirname, const char* filename); - char* memory_get_path_from_ueid(const char* dirname, const char* filename, int ueid); int memory_read(const char* datafile, void* data, size_t size);