src/line_proto.c
changeset 47 7d4094eb3117
parent 45 71e65564afd2
child 156 6534a4ac957b
equal deleted inserted replaced
46:0c13bca53ae1 47:7d4094eb3117
    44  *
    44  *
    45  * Notify the user callback, which will probably call line_proto_release().
    45  * Notify the user callback, which will probably call line_proto_release().
    46  */
    46  */
    47 static void line_proto_set_error (struct line_proto *lp)
    47 static void line_proto_set_error (struct line_proto *lp)
    48 {
    48 {
       
    49     // copy error_info, as it might get free'd
       
    50     struct error_info err = lp->err;
       
    51 
    49     // trigger callback
    52     // trigger callback
    50     lp->callbacks.on_error(&lp->err, lp->cb_arg);
    53     lp->callbacks.on_error(&err, lp->cb_arg);
    51 }
    54 }
    52 
    55 
    53 /**
    56 /**
    54  * Our sock_stream on_read handler
    57  * Our sock_stream on_read handler
    55  */
    58  */