save-git: allocate user_info members on the heap

subsurface_user_info() only works on Linux (linux.c),
but it doesn't allocate values on the heap.

Solve this ownership problem by always allocating
.name and .email on the heap in subsurface_user_info()
and freeing in the caller.

If subsurface_user_info() did not modify any of the
values from NULL, use default ones, but allocate them
on the heap too.

Ref #1346

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2018-07-08 00:26:24 +03:00 committed by Dirk Hohndel
parent 2de5b95acf
commit 94d6e5d851
3 changed files with 14 additions and 12 deletions

View file

@ -712,8 +712,8 @@ int cylinderuse_from_text(const char *text);
struct user_info {
const char *name;
const char *email;
char *name;
char *email;
};
extern void subsurface_user_info(struct user_info *);