chiark / gitweb /
password-agent: actually really don't access unallocated memory
authorLennart Poettering <lennart@poettering.net>
Mon, 4 Jul 2011 17:06:32 +0000 (19:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 4 Jul 2011 17:06:43 +0000 (19:06 +0200)
Fix for 9726f9ff11fa7b94dceed2972cd2453a08b9ee6a

src/tty-ask-password-agent.c

index 38442f66bda3e61ecd46213f07ef7bf46f77792c..02b959ea591e1137d963ec1d4309e6e026d1f506 100644 (file)
@@ -384,9 +384,9 @@ static int parse_password(const char *filename, char **wall) {
                                         packet[0] = '+';
                                         strcpy(packet+1, password);
                                 }
-                        }
 
-                        free(password);
+                                free(password);
+                        }
                 }
 
                 if (r == -ETIME || r == -ENOENT) {