Skip to content
Snippets Groups Projects
Commit e4a0fe68 authored by Morris Jette's avatar Morris Jette
Browse files

Fix for possible NULL pointer reference

Coverity CID 182335
parent dc2494d9
No related branches found
No related tags found
No related merge requests found
...@@ -1848,10 +1848,14 @@ uint16_t parse_compress_type(const char *arg) ...@@ -1848,10 +1848,14 @@ uint16_t parse_compress_type(const char *arg)
extern int validate_acctg_freq(char *acctg_freq) extern int validate_acctg_freq(char *acctg_freq)
{ {
int i; int i;
char *save_ptr = NULL, *tok, *tmp = xstrdup(optarg); char *save_ptr = NULL, *tok, *tmp;
bool valid; bool valid;
int rc = SLURM_SUCCESS; int rc = SLURM_SUCCESS;
if (!optarg)
return rc;
tmp = xstrdup(optarg);
tok = strtok_r(tmp, ",", &save_ptr); tok = strtok_r(tmp, ",", &save_ptr);
while (tok) { while (tok) {
valid = false; valid = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment