summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorMuhammad Zahalqa <m@tryfinally.com>2020-08-13 19:21:54 +0300
committerAndreas Kling <kling@serenityos.org>2020-08-13 18:53:32 +0200
commit138595961baac929df280264f3bdb729a6be33fa (patch)
tree294840d28440e46de806a5d2e9f3b46371b039f6 /Libraries
parent6e1d6d1ff5855028a50cc8f4bc8c0f91161cf765 (diff)
downloadserenity-138595961baac929df280264f3bdb729a6be33fa.zip
LibC: mark strdup & strndup as __attribute__((malloc))
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibC/string.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibC/string.h b/Libraries/LibC/string.h
index 0d8a0a194a..c2b5fb40f5 100644
--- a/Libraries/LibC/string.h
+++ b/Libraries/LibC/string.h
@@ -45,8 +45,8 @@ const void* memmem(const void* haystack, size_t, const void* needle, size_t);
void bzero(void*, size_t);
void bcopy(const void*, void*, size_t);
void* memset(void*, int, size_t);
-char* strdup(const char*);
-char* strndup(const char*, size_t);
+__attribute__((malloc)) char* strdup(const char*);
+__attribute__((malloc)) char* strndup(const char*, size_t);
char* strcpy(char* dest, const char* src);
char* strncpy(char* dest, const char* src, size_t);
char* strchr(const char*, int c);