2626 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727 * SUCH DAMAGE.
2828 *
29- * $Id: px.c,v 1.1 2001/08/21 01:32:01 momjian Exp $
29+ * $Id: px.c,v 1.2 2001/09/06 03:21:39 momjian Exp $
3030 */
3131
3232#include <postgres.h>
@@ -208,7 +208,7 @@ combo_free(PX_Combo *cx)
208208
209209/* PARSER */
210210
211- static void
211+ static int
212212parse_cipher_name (char * full ,char * * cipher ,char * * pad )
213213{
214214char * p ,* p2 ,* q ;
@@ -229,14 +229,16 @@ parse_cipher_name(char *full, char **cipher, char **pad)
229229p2 = strchr (p ,':' );
230230if (p2 != NULL ) {
231231* p2 ++ = 0 ;
232- if (!strcmp (p ,"pad" )) {
232+ if (!strcmp (p ,"pad" ))
233233* pad = p2 ;
234- }else {
235- elog (ERROR ,"Unknown component: '%s'" ,p );
236- }
237- }
234+ else
235+ return -1 ;
236+ }else
237+ return -1 ;
238+
238239p = q ;
239240}
241+ return 0 ;
240242}
241243
242244/* provider */
@@ -255,11 +257,11 @@ px_find_combo(const char *name, PX_Combo **res)
255257buf = px_alloc (strlen (name )+ 1 );
256258strcpy (buf ,name );
257259
258- parse_cipher_name (buf ,& s_cipher ,& s_pad );
259- if (s_cipher == NULL ) {
260+ err = parse_cipher_name (buf ,& s_cipher ,& s_pad );
261+ if (err ) {
260262px_free (buf );
261263px_free (cx );
262- return -1 ;
264+ return err ;
263265}
264266
265267err = px_find_cipher (s_cipher ,& cx -> cipher );