mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
2de5b95acf
commit
94d6e5d851
3 changed files with 14 additions and 12 deletions
|
|
@ -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 *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue