jcs
/subtext
/amendments
/268
zmodem: Make our own copy of upload path in ZCreateReceiver
We were not owning this string, so in ZDestroy we were free()ing a
pointer behind the caller's back.
jcs made amendment 268 over 2 years ago
--- zmodem.c Sun Jul 31 22:03:07 2022
+++ zmodem.c Sun Nov 6 20:56:14 2022
@@ -266,7 +266,7 @@ ZCreateReceiver(struct session *session, char *path)
zs = xmalloczero(sizeof(struct zmodem_session), "ZCreateReceiver");
zs->session = session;
zs->ZMode = IdZAutoR;
- zs->upload_file_path = path;
+ zs->upload_file_path = xstrdup(path, "zmodem path");
return zs;
}