unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: 8761@debbugs.gnu.org
Subject: bug#8761: gnutls should use xmalloc not malloc
Date: Tue, 31 May 2011 09:28:27 -0500	[thread overview]
Message-ID: <87zkm37xmc.fsf@lifelogs.com> (raw)
In-Reply-To: <4DE356CE.6000305@cs.ucla.edu>

On Mon, 30 May 2011 01:35:26 -0700 Paul Eggert <eggert@cs.ucla.edu> wrote: 

PE> Here's a proposed patch for the problem.
PE> * gnutls.c: Use Emacs's memory allocators.
PE> Without this change, the gnutls library would invoke malloc etc.
PE> directly, which causes problems on non-SYNC_INPUT hosts, and which
PE> runs afoul of improving memory_full behavior.
PE> (fn_gnutls_global_set_mem_functions): New macro or function pointer.
PE> (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
PE> xfree instead of the default malloc, realloc, free.
PE> (Fgnutls_boot): No need to check for memory allocation failure,
PE> since xmalloc does that for us.

This looks good.

PE> -      if (fn_gnutls_certificate_allocate_credentials (&x509_cred) < 0)
PE> -        memory_full ();
PE> +      fn_gnutls_certificate_allocate_credentials (&x509_cred);

PE> -      if (fn_gnutls_anon_allocate_client_credentials (&anon_cred) < 0)
PE> -        memory_full ();
PE> +      fn_gnutls_anon_allocate_client_credentials (&anon_cred);

I'm OK with the change, but how do I test that it behaves properly?

Ted






  reply	other threads:[~2011-05-31 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-30  8:35 bug#8761: gnutls should use xmalloc not malloc Paul Eggert
2011-05-31 14:28 ` Ted Zlatanov [this message]
2011-06-02 18:40 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zkm37xmc.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=8761@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).