Meco Man 3 жил өмнө
parent
commit
badddbbc7d

+ 1 - 1
tftp/tftp_server.c

@@ -551,7 +551,7 @@ struct tftp_server *tftp_server_create(const char *root_name, int port)
     }
     /* init server object */
     rt_memset(server, 0, mem_len);
-    server->root_name = strdup(root_name);
+    server->root_name = rt_strdup(root_name);
     if (server->root_name == NULL)
     {
         free(server);

+ 3 - 3
tftp/tftp_xfer.c

@@ -314,7 +314,7 @@ void tftp_xfer_mode_set(struct tftp_xfer *xfer, const char *mode)
     {
         free(xfer->mode);
     }
-    xfer->mode = strdup(mode);
+    xfer->mode = rt_strdup(mode);
 }
 
 int tftp_xfer_blksize_set(struct tftp_xfer *xfer, int blksize)
@@ -356,11 +356,11 @@ struct tftp_xfer *tftp_xfer_create(const char *ip_addr, int port)
     }
 
     /* Initialize private data */
-    _private->ip_addr = strdup(ip_addr);
+    _private->ip_addr = rt_strdup(ip_addr);
     _private->port = port;
     _private->block = 0;
     xfer->sock = sock;
-    xfer->mode = strdup(TFTP_XFER_OCTET);
+    xfer->mode = rt_strdup(TFTP_XFER_OCTET);
     xfer->blksize = XFER_DATA_SIZE_MAX;
     xfer->_private = _private;
     return xfer;