We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 664817b commit a71fc6fCopy full SHA for a71fc6f
lib/gshadow.c
@@ -140,8 +140,9 @@ void endsgent (void)
140
/*@observer@*//*@null@*/struct sgrp *
141
fgetsgent(/*@null@*/FILE *fp)
142
{
143
- static size_t buflen = 0;
144
- static char *buf = NULL;
+ char *buf = NULL;
+ size_t buflen = 0;
145
+ struct sgrp *sg;
146
147
if (NULL == fp) {
148
return NULL;
@@ -152,7 +153,11 @@ fgetsgent(/*@null@*/FILE *fp)
152
153
if (stpsep(buf, "\n") == NULL)
154
155
- return (sgetsgent (buf));
156
+ sg = sgetsgent(buf);
157
+
158
+ free(buf);
159
160
+ return sg;
161
}
162
163
0 commit comments