]> git.meshlink.io Git - utcp/blobdiff - utcp.c
Keep a copy of the old receive callback before calling reset_connection().
[utcp] / utcp.c
diff --git a/utcp.c b/utcp.c
index d09b9e7d526e80c4ce39590c19c718904fe32590..9fb68aecd323dd2019171df1b86199c37af71544 100644 (file)
--- a/utcp.c
+++ b/utcp.c
@@ -1664,11 +1664,13 @@ void utcp_abort_all_connections(struct utcp *utcp) {
                        continue;
                }
 
+               utcp_recv_t old_recv = c->recv;
+
                reset_connection(c);
 
-               if(c->recv) {
+               if(old_recv) {
                        errno = 0;
-                       c->recv(c, NULL, 0);
+                       old_recv(c, NULL, 0);
                }
        }