Remove redundant memset call following palloc0
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 13 Oct 2022 21:18:00 +0000 (23:18 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 13 Oct 2022 21:18:00 +0000 (23:18 +0200)
This is a follow-up commit to ca7f8e2 which removed the allocation
abstraction from pgcrypto and replaced px_alloc + memset calls with
palloc0 calls. The particular memset in this commit was missed in
that work though.

Author: Zhihong Yu <zyu@yugabyte.com>
Reviewed-by: Bruce Momjian <bruce@momjian.us>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/CALNJ-vT5qRucrFMPSzQyAWods1b4MnNPG-M=_ZUzh1SoTh0vNw@mail.gmail.com

contrib/pgcrypto/px.c

index 3b098c61514a41e2fb9ef19863e1ed460cf1dd57..d35ccca77746d8dba8ffc360ea8b90c90bba297c 100644 (file)
@@ -203,7 +203,6 @@ combo_init(PX_Combo *cx, const uint8 *key, unsigned klen,
    if (klen > ks)
        klen = ks;
    keybuf = palloc0(ks);
-   memset(keybuf, 0, ks);
    memcpy(keybuf, key, klen);
 
    err = px_cipher_init(c, keybuf, klen, ivbuf);