pkarashchenko commented on code in PR #14945:
URL: https://github.com/apache/nuttx/pull/14945#discussion_r1858018595
##########
libs/libbuiltin/libgcc/gcov.c:
##########
@@ -315,10 +320,23 @@ void __gcov_dump(void)
FAR struct gcov_info *info;
FAR const char *strip = getenv("GCOV_PREFIX_STRIP");
FAR const char *prefix = getenv("GCOV_PREFIX");
- FAR char *prefix2 = strdup(prefix);
FAR char new_path[PATH_MAX];
+ FAR char *prefix2;
int ret;
+ if (!prefix)
+ {
+ syslog(LOG_ERR, "No path prefix specified");
+ return;
+ }
+
+ prefix2 = strdup(prefix);
+ if (!prefix2)
Review Comment:
Optional
```suggestion
if (prefix2 == NULL)
```
##########
libs/libbuiltin/libgcc/gcov.c:
##########
@@ -315,10 +320,23 @@ void __gcov_dump(void)
FAR struct gcov_info *info;
FAR const char *strip = getenv("GCOV_PREFIX_STRIP");
FAR const char *prefix = getenv("GCOV_PREFIX");
- FAR char *prefix2 = strdup(prefix);
FAR char new_path[PATH_MAX];
+ FAR char *prefix2;
int ret;
+ if (!prefix)
Review Comment:
Optional
```suggestion
if (prefix == NULL)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]