mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-17 15:32:21 +08:00
Fixes in asprintf usage.
This commit is contained in:

committed by
Xiang Xiao

parent
cf54069487
commit
c50ff7ff61
@@ -1007,12 +1007,13 @@ static ssize_t ftpd_response(int sd, int timeout, FAR const char *fmt, ...)
|
||||
FAR char *buffer;
|
||||
ssize_t bytessent;
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vasprintf(&buffer, fmt, ap);
|
||||
ret = vasprintf(&buffer, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (buffer == NULL)
|
||||
if (ret < 0)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -2417,8 +2418,8 @@ static int fptd_listscan(FAR struct ftpd_session_s *session, FAR char *path,
|
||||
}
|
||||
}
|
||||
|
||||
asprintf(&temp, "%s/%s", path, entry->d_name);
|
||||
if (temp == NULL)
|
||||
ret = asprintf(&temp, "%s/%s", path, entry->d_name);
|
||||
if (ret < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user