Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #75258

Re: Memorry error?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.c
Subject Re: Memorry error?
Date 2015-11-07 08:36 -0500
Organization A noiseless patient Spider
Message-ID <n1kuko$hr2$1@dont-email.me> (permalink)
References <892c6f15-df18-4132-a798-5fed68982edc@googlegroups.com> <cdb29e98-5047-48bd-b005-750c96dff15a@googlegroups.com>

Show all headers | View raw


On 11/7/2015 8:30 AM, Alla _ wrote:
> I have also done another version that creates a tiny csv file with
> the data. Same output:
> 1) name and house on different lines, as above
> 2) struct-1(569) malloc: *** error for object 0x7fff6166b9f8: pointer being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
> Abort trap: 6

     The final loop is the problem: It calls free() on the `name'
and `house' elements of each `struct student', but the memory for
these elements was not obtained from malloc() (or its cousins).
You must not free() anything that you didn't malloc().

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:18 -0800
  Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:19 -0800
  Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:27 -0800
  Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 05:30 -0800
    Re: Memorry error? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-07 08:36 -0500
      Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 06:43 -0800
        Re: Memorry error? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-11-07 17:22 +0000
  Re: Memorry error? "Osmium" <r124c4u102@comcast.net> - 2015-11-07 07:33 -0600
  Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-07 06:47 -0800
    Re: Memorry error? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-07 10:36 -0500
    Re: Memorry error? Keith Thompson <kst-u@mib.org> - 2015-11-07 13:37 -0800
    Re: Memorry error? Barry Schwarz <schwarzb@dqel.com> - 2015-11-07 16:26 -0800
      Re: Memorry error? Alla _ <modelling.data@gmail.com> - 2015-11-08 23:03 -0800
        Re: Memorry error? Barry Schwarz <schwarzb@dqel.com> - 2015-11-09 01:01 -0800
          Re: Memorry error? Keith Thompson <kst-u@mib.org> - 2015-11-09 08:27 -0800
            Re: Memorry error? raltbos@xs4all.nl (Richard Bos) - 2015-11-17 22:23 +0000
              Re: Memorry error? Keith Thompson <kst-u@mib.org> - 2015-11-17 15:31 -0800
                Re: Memorry error? raltbos@xs4all.nl (Richard Bos) - 2015-11-19 10:41 +0000
      Re: Memorry error? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-11-09 10:26 +0000

csiph-web