Fixes following issue reported by clang-12 static analyzer:
uclient-fetch.c:612:25: warning: Potential leak of memory pointed to by 'username' [unix.Malloc]
memset(optarg, '*', strlen(optarg));
^~~~~~~~~~~~~~
uclient-fetch.c:618:25: warning: Potential leak of memory pointed to by 'password' [unix.Malloc]
memset(optarg, '*', strlen(optarg));
^~~~~~~~~~~~~~
Signed-off-by: Petr Štetiar <ynezz@true.cz>
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: