Fix variable assignment thinko in hba.c
authorMichael Paquier <[email protected]>
Wed, 26 Oct 2022 03:57:40 +0000 (12:57 +0900)
committerMichael Paquier <[email protected]>
Wed, 26 Oct 2022 03:57:40 +0000 (12:57 +0900)
The intention behind 1b73d0b was to limit the use of TokenizedAuthLine,
but I have fat-fingered one location in parse_hba_line() when creating
the HbaLine, where this should use the local variable and not the value
coming from TokenizedAuthLine.  This logic is the exactly the same, but
let's be clean about all that on consistency grounds.

Reported-by: Julien Rouhaud
Discussion: https://postgr.es/m/20221026032730.k3sib5krgm7l6njk@jrouhaud

src/backend/libpq/hba.c

index 78e83c17c7b504c6494d2b0a52905a204a0b524c..e9fc0af7c9ed88c57558ec769cf5badb92aca894 100644 (file)
@@ -1079,7 +1079,7 @@ parse_hba_line(TokenizedAuthLine *tok_line, int elevel)
    HbaLine    *parsedline;
 
    parsedline = palloc0(sizeof(HbaLine));
-   parsedline->sourcefile = pstrdup(tok_line->file_name);
+   parsedline->sourcefile = pstrdup(file_name);
    parsedline->linenumber = line_num;
    parsedline->rawline = pstrdup(tok_line->raw_line);