@@ -1456,9 +1456,10 @@ nsdb_enumerate_nsdbs(char ***nsdblist)
char *tmp;
tmp = malloc(strlen(hostname) + strlen(":") + strlen(port) + 1);
- if (tmp == NULL)
+ if (tmp == NULL) {
nsdb_free_string_array(result);
goto out_free;
+ }
(void)sprintf(tmp, "%s:%s", hostname, port);
@@ -378,9 +378,10 @@ nsdb_posix_to_path_array(const char *pathname, char ***path_array)
length = next - component;
result[i] = strndup(component, length);
- if (result[i] == NULL)
+ if (result[i] == NULL) {
nsdb_free_string_array(result);
return FEDFS_ERR_SVRFAULT;
+ }
if (*next == '\0')
break;
Commit 6c5caeef was a little too aggressive. Fixes: 6c5caeefe64796cfcc26348e2ce4ad886fad9fa0 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- src/libnsdb/nsdb.c | 3 ++- src/libnsdb/path.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)