]> Nishi Git Mirror - libw3.git/commitdiff
memleak fix
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 06:03:19 +0000 (06:03 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 06:03:19 +0000 (06:03 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@87 d27a3e52-49c5-7645-884c-6793ebffc270

Example/W3B/w3b.c

index 7ff50581efe0d7ca05b6a218bfb4c326be2e8bca..c7a65cd840a1f845fb5f54e24c34dfe325bc9aaa 100644 (file)
@@ -31,6 +31,7 @@ void data_handler(struct W3* w3, char* data, size_t size) {
                memcpy(databuf, oldbuf, datalen);
                memcpy(databuf + datalen, data, size);
                datalen += size;
+               free(oldbuf);
        }
 }