Hacker News new | past | comments | ask | show | jobs | submit login

You shouldn't allocate heap space for a pointer in blocking_pipe_read. Also, it looks like you're leaking it in the else branch.

Just allocate a pointer on the stack, read into it, and then assign the value into the provided space:

    void *msg_ptr;
    read(..., &msg_ptr, sizeof msg_ptr);
    *data = msg_ptr;



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: