You appear to be using the prv pointer before you've set it. On the first pass through add_element() it will still be set to NULL so prv->next can't be used at that point.
There's a lot of better programmers than me hang out here, but the way I'd do it would be to have a
struct node *firstNode and
struct node *lastNode
When you add a new node:
If firstNode is NULL then set it to point to the new entry.
If lastNode is not NULL, set lastNode->next to point to new entry.
set lastNode to point to the new entry.
set lastNode->next to NULL.
Been a long time since I've done anything like this but I think that's about right. (I'm sure someone will correct me if it's not