]> git.ipfire.org Git - thirdparty/shadow.git/commit
Only free sgent if it was initialized 417/head
authorMichael Vetter <jubalh@iodoru.org>
Mon, 20 Sep 2021 09:04:50 +0000 (11:04 +0200)
committerMichael Vetter <jubalh@iodoru.org>
Mon, 20 Sep 2021 09:04:50 +0000 (11:04 +0200)
commit117bc66c6f95fa85ca75ecfdb8fbd3615deca0b6
tree04d9bc36396fac6fab00e33444b67724d96c0474
parent26bbee8c86f496103472c6b366022deba3d5c260
Only free sgent if it was initialized

`sgent` is only initialized in `get_group()` if `is_shadowgrp` is true.
So we should also only attempt to free it if this is actually the case.

Can otherwise lead to:
```
free() double free detected in tcache 2 (gpasswd)
```
src/gpasswd.c