diff options
Diffstat (limited to 'nuttx/netutils/thttpd/thttpd_alloc.c')
-rwxr-xr-x | nuttx/netutils/thttpd/thttpd_alloc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/nuttx/netutils/thttpd/thttpd_alloc.c b/nuttx/netutils/thttpd/thttpd_alloc.c index 85f79adc4..a4d64e3c6 100755 --- a/nuttx/netutils/thttpd/thttpd_alloc.c +++ b/nuttx/netutils/thttpd/thttpd_alloc.c @@ -147,6 +147,25 @@ void httpd_free(FAR void *ptr) } #endif +#ifdef CONFIG_THTTPD_MEMDEBUG +FAR char *httpd_strdup(const char *str) +{ + FAR char *newstr = strdup(str); + if (!newstr) + { + ndbg("strdup of %s failed\n", str); + } + else + { + nvdbg("strdup'ed %s\n", str); + g_nallocations++; + g_allocated += (strlen(str)+1); + } + httpd_memstats(); + return newstr; +} +#endif + /* Helpers to implement dynamically allocated strings */ void httpd_realloc_str(char **pstr, size_t *maxsize, size_t size) |