uclient-fetch: fix potential memory leaks
[project/uclient.git] / uclient-fetch.c
index 0c7a1232f2565c96beb8a31fd83c460ebb6d987e..1c66ac6d33ae6d5cf24bd8379e7d5233746ca1b5 100644 (file)
@@ -608,13 +608,13 @@ int main(int argc, char **argv)
                        case L_USER:
                                if (!strlen(optarg))
                                        break;
-                               username = strdup(optarg);
+                               username = strdupa(optarg);
                                memset(optarg, '*', strlen(optarg));
                                break;
                        case L_PASSWORD:
                                if (!strlen(optarg))
                                        break;
-                               password = strdup(optarg);
+                               password = strdupa(optarg);
                                memset(optarg, '*', strlen(optarg));
                                break;
                        case L_USER_AGENT: