summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/xfer/xfer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c
index cef7a23e2..2032a29f6 100644
--- a/src/plugins/xfer/xfer.c
+++ b/src/plugins/xfer/xfer.c
@@ -851,7 +851,8 @@ xfer_set_remote_address (struct t_xfer *xfer, const struct sockaddr *address,
free (xfer->remote_address);
xfer->remote_address = malloc (length);
xfer->remote_address_length = length;
- memcpy (xfer->remote_address, address, length);
+ if (xfer->remote_address)
+ memcpy (xfer->remote_address, address, length);
if (xfer->remote_address_str)
free (xfer->remote_address_str);
@@ -869,7 +870,8 @@ xfer_set_local_address (struct t_xfer *xfer, const struct sockaddr *address,
free (xfer->local_address);
xfer->local_address = malloc (length);
xfer->local_address_length = length;
- memcpy (xfer->local_address, address, length);
+ if (xfer->local_address)
+ memcpy (xfer->local_address, address, length);
if (xfer->local_address_str)
free (xfer->local_address_str);